Skip to content
Commit d1ea28fc authored by Tobias Deiminger's avatar Tobias Deiminger
Browse files

Avoid crash during session restore

Summary:
Do all access to the passed KConfigGroup really synchronous to KMainWindow::readProperties, then we're safe.

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.

BUGS: 395765

Test Plan:
- get recent Qt5 and KF5
- manually save desktop session while a document is open in okular
- modify ~/.config/session/okular_<sessionid> so that Urls points to non existing file
- manually restore session with okular -session <session_id>, dialog will open and warn about non existent file
- okular shall not crash after closing that dialog

Reviewers: aacid

Reviewed By: aacid

Subscribers: aacid, okular-devel

Tags: #okular

Differential Revision: https://phabricator.kde.org/D16457
parent dcacd830
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment