Fix KMail crash on exit, possibly accessing status bar during destruction
ClosedPublic

Authored by marten on Mar 12 2018, 9:10 AM.

Details

Summary

The backtraces in bug https://bugs.kde.org/show_bug.cgi?id=387177 appear to show a crash as a result of accessing the main window's status bar during destruction, with running Akonadi jobs being killed and trying to show a status message. By this time, the status bar has already been destroyed.

This change disconnects the broadcast status message signal from the status bar before it is destroyed.

Test Plan

Previously this crash happened regularly. Since rebuilding kmail with this change, I have not experienced any such crash over a number of weeks when quitting the application, whether it is busy or not.

Diff Detail

Repository
R206 KMail
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
marten created this revision.Mar 12 2018, 9:10 AM
Restricted Application added a project: KDE PIM. · View Herald TranscriptMar 12 2018, 9:10 AM
marten requested review of this revision.Mar 12 2018, 9:10 AM
dvratil accepted this revision.Mar 12 2018, 9:44 AM
dvratil added a subscriber: dvratil.

I wonder if we should just kill all Akonadi jobs quitely (without them emitting the result() signal) during the Akonadi Session teardown. That would prevent this kind of problems entirely. Akonadi Sessions are typically destroyed on application shutdown so you likely won't make any use of the job results anyway...

This revision is now accepted and ready to land.Mar 12 2018, 9:44 AM
This revision was automatically updated to reflect the committed changes.