<table><tr><td style="">elvisangelaccio created this revision.<br />elvisangelaccio added a reviewer: rthomsen.<br />elvisangelaccio added a subscriber: kde-utils-devel.<br />elvisangelaccio set the repository for this revision to rARK Ark.<br />elvisangelaccio added a project: Ark.</td><a style="text-decoration: none; padding: 4px 8px; margin: 0 8px 8px; float: right; color: #464C5C; font-weight: bold; border-radius: 3px; background-color: #F7F7F9; background-image: linear-gradient(to bottom,#fff,#f1f0f1); display: inline-block; border: 1px solid rgba(71,87,120,.2);" href="https://phabricator.kde.org/D1786" rel="noreferrer">View Revision</a></tr></table><br /><div><strong>REVISION SUMMARY</strong><div><p><tt style="background: #ebebeb; font-size: 13px;">QDialog::exec()</tt> 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 <a href="https://blogs.kde.org/node/3919" class="remarkup-link" target="_blank" rel="noreferrer">old workaround</a> (which Ark uses) is to use a <tt style="background: #ebebeb; font-size: 13px;">QPointer</tt> to guard the dialog. Yet I can reproduce a crash by calling <tt style="background: #ebebeb; font-size: 13px;">QCoreApplication::quit()</tt> via dbus while the dialog is open.</p>
<p>The proper fix is to call the dialog in a non-blocking way. Nowadays this is trivial thanks to C++11 lambdas.</p></div></div><br /><div><strong>TEST PLAN</strong><div><p>Steps to reproduce the crash (without the patch):</p>
<ul class="remarkup-list">
<li class="remarkup-list-item">Run ark and open the "Open Archive" dialog (CTRL+O)</li>
<li class="remarkup-list-item">Run <tt style="background: #ebebeb; font-size: 13px;">qdbusviewer</tt></li>
<li class="remarkup-list-item">Type ark in the search bar</li>
<li class="remarkup-list-item">Call the <tt style="background: #ebebeb; font-size: 13px;">MainApplication/org.qtproject.Qt.QCoreApplication/quit</tt> method (right-click on it)</li>
</ul></div></div><br /><div><strong>REPOSITORY</strong><div><div>rARK Ark</div></div></div><br /><div><strong>REVISION DETAIL</strong><div><a href="https://phabricator.kde.org/D1786" rel="noreferrer">https://phabricator.kde.org/D1786</a></div></div><br /><div><strong>AFFECTED FILES</strong><div><div>app/mainwindow.cpp</div></div></div><br /><div><strong>EMAIL PREFERENCES</strong><div><a href="https://phabricator.kde.org/settings/panel/emailpreferences/" rel="noreferrer">https://phabricator.kde.org/settings/panel/emailpreferences/</a></div></div><br /><div><strong>To: </strong>elvisangelaccio, rthomsen<br /><strong>Cc: </strong>kde-utils-devel, tctara<br /></div>