Skip to content
  • Daniel Vrátil's avatar
    Fix crash when Connection is closed while ItemRetriever is running · 1593c17d
    Daniel Vrátil authored
    ItemRetriever::exec() runs a nested QEventLoop. If the parent
    Connection is terminated while the event loop is running, the
    delayed AkThread::quit() invocation is executed and the thread
    is destroyed, while technically there is still execution going
    on. To workaround that issue we don't destroy the thread in
    Connection::quit() if we detect a nested QEventLoop but instead
    we just notify the event loop to quit and destroy the thread
    later when execution returns back to ItemRetriever::slotNewData().
    
    This fixes a crash in QPSQLQuery, which was dereferencing a
    QPSQLDriver after the driver has been deleted as the thread was
    destroyed and avoids more of random crashes due to the Connection
    being virtually deleted from its own nested event loop.
    
    BUG: 374734
    FIXED-IN: 5.4.3
    1593c17d