Single sql connection should not be used from a different thread that it is created in (and some drivers may have additional limitations). Correct me if I am wrong, but I believe it should be working in a way that I implemented it in attached example.
This does not happen every time, but running this example 10 times usually fails somewhere.
Sometimes error messages are printed, such as:
Sometimes there is an assert:
It may also get stuck in qt_call_post_routines() (qcoreapplication.cpp) calling (list->takeFirst())() which makes calls to cleanDriverDict continuously.
Sometimes it may even crash (see attachment). Sometimes it crashes inside sqlite library too.
|For Gerrit Dashboard: QTBUG-42855|
|179497,3||Fix race condition in QFactoryLoader: lock the mutex we already have||5.8||qt/qtbase||Status: MERGED||+2||0|
|302588,2||Add missing lock in QFactoryLoader||5.15||qt/qtbase||Status: MERGED||+2||0|
|302625,2||Add missing lock in QFactoryLoader||dev||qt/qtbase||Status: MERGED||+2||0|