[Differential] [Request, 12 lines] D1786: Fix crash with blocking Open dialog
elvisangelaccio (Elvis Angelaccio)
noreply at phabricator.kde.org
Tue Jun 7 10:21:55 UTC 2016
elvisangelaccio created this revision.
elvisangelaccio added a reviewer: rthomsen.
elvisangelaccio added a subscriber: kde-utils-devel.
elvisangelaccio set the repository for this revision to rARK Ark.
elvisangelaccio added a project: Ark.
REVISION SUMMARY
`QDialog::exec()` is bad and should not be used unless strictly necessary. The exec() call is blocking and anything can happen before it returns to the caller. The old workaround <https://blogs.kde.org/node/3919> (which Ark uses) is to use a `QPointer` to guard the dialog. Yet I can reproduce a crash by calling `QCoreApplication::quit()` via dbus while the dialog is open.
The proper fix is to call the dialog in a non-blocking way. Nowadays this is trivial thanks to C++11 lambdas.
TEST PLAN
Steps to reproduce the crash (without the patch):
- Run ark and open the "Open Archive" dialog (CTRL+O)
- Run `qdbusviewer`
- Type ark in the search bar
- Call the `MainApplication/org.qtproject.Qt.QCoreApplication/quit` method (right-click on it)
REPOSITORY
rARK Ark
REVISION DETAIL
https://phabricator.kde.org/D1786
AFFECTED FILES
app/mainwindow.cpp
EMAIL PREFERENCES
https://phabricator.kde.org/settings/panel/emailpreferences/
To: elvisangelaccio, rthomsen
Cc: kde-utils-devel, tctara
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-utils-devel/attachments/20160607/2fb0a732/attachment.html>
More information about the Kde-utils-devel
mailing list