D7285: pim-sieve-editor: sieveeditormainwindow: use QPointer to protect crash of ImportImapSettingWizard
Daniel Vrátil
noreply at phabricator.kde.org
Tue Aug 15 15:08:30 BST 2017
dvratil added a comment.
Open the editor window, then open the import wizard. Now close the editor window (through any means) and then close/accept the import wizard and it will crash. When you close the `SieveEditorMainWindow` it is deleted, which in turn deletes the `ImportImapSettingWizard` because we passed the `SieveEditorMainWindow` as its parent. This won't, however, quit the wizard. When you close the wizard and the code returns from `slotImportImapSettings()`, the `w` variable will go out-of-scope, causing `ImportImapSettingWizard`'s destructor to be called **again** -> booom :-)
IOW anything that uses nested QEventLoops shouldn't be created on the stack and should be guarded by QPointer.
REPOSITORY
R213 PIM Sieve Editor
REVISION DETAIL
https://phabricator.kde.org/D7285
To: winterz, mlaurent
Cc: dvratil, dkurz, #kde_pim, dvasin, winterz, vkrause, mlaurent, knauss
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-pim/attachments/20170815/e607b4d7/attachment.html>
More information about the kde-pim
mailing list