<table><tr><td style="">tobiasdeiminger created this revision.<br />Herald added a project: Okular.<br />Herald added a subscriber: okular-devel.<br />tobiasdeiminger requested review of this revision.
</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/D16457">View Revision</a></tr></table><br /><div><strong>REVISION SUMMARY</strong><div><p>Do all access to the passed KConfigGroup really synchronous to KMainWindow::readProperties, then we're safe.</p>

<p>Currently kxmlgui can't guarantee that the passed KConfigGroup is still valid after our call to Shell::openUrl(). This is because inside Shell::openUrl, QDialog::exec may get called. The stacked event loop processes all kinds of asynchronous events, and litterally *anything* can happen. E.g. incoming ICE and DBus messages may be processed. In bug 395765 it happened that XSMP SafeYourself was processed, which calls KConfigGui::setSessionConfig, which leaves the KConfig pointer inside KConfigGroup dangling.</p>

<p>BUGS: 395765</p></div></div><br /><div><strong>TEST PLAN</strong><div><ul class="remarkup-list">
<li class="remarkup-list-item">get recent Qt5 and KF5</li>
<li class="remarkup-list-item">manually save desktop session while a document is open in okular</li>
<li class="remarkup-list-item">modify ~/.config/session/okular_<sessionid> so that Urls points to non existing file</li>
<li class="remarkup-list-item">manually restore session with okular -session <session_id>, dialog will open and warn about non existent file</li>
<li class="remarkup-list-item">okular shall not crash after closing that dialog</li>
</ul></div></div><br /><div><strong>REPOSITORY</strong><div><div>R223 Okular</div></div></div><br /><div><strong>BRANCH</strong><div><div>avoid_crash_session_restore</div></div></div><br /><div><strong>REVISION DETAIL</strong><div><a href="https://phabricator.kde.org/D16457">https://phabricator.kde.org/D16457</a></div></div><br /><div><strong>AFFECTED FILES</strong><div><div>shell/shell.cpp</div></div></div><br /><div><strong>To: </strong>tobiasdeiminger<br /><strong>Cc: </strong>okular-devel, ngraham, aacid<br /></div>