Skip to content
Commit 1593c17d authored by Daniel Vrátil's avatar Daniel Vrátil 🤖
Browse files

Fix crash when Connection is closed while ItemRetriever is running

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
parent 5219f770
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