Skip to content
  • Tobias Deiminger's avatar
    Avoid crash during session restore · d1ea28fc
    Tobias Deiminger authored
    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
    d1ea28fc