Details
-
Bug
-
Resolution: Fixed
-
P3: Somewhat important
-
5.15, 6.5.0
-
None
-
-
048a68c1e (dev), 8d2bdc9cd (6.5)
Description
How to reproduce:
- Open two QSqlDatabase in separate threads in parallel.
What happens:
- On shutdown when QApplication is freed, there is an endless loop.
I found following cause:
- When two SQL connections are created in parallel, QSqlDatabasePrivate::driverDict() is called twice in parallel. This will call qAddPostRoutine(cleanDriverDict); twice and cleanDriverDict will appear twice in the PostRoutines.
- During shutdown, the second cleanDriverDict calls driverDict() again, which reinitializes qDriverDictInit and adds another qAddPostRoutine. So the cleanDriverDict will be called and added again and again.
Attachments
For Gerrit Dashboard: QTBUG-112961 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
479729,1 | SQL: Make QSqlDatabase::DriverDict creation thread-safe | tqtc/lts-6.2 | qt/tqtc-qtbase | Status: NEW | 0 | 0 |
479730,1 | SQL: Make QSqlDatabase::DriverDict creation thread-safe | tqtc/lts-5.15 | qt/tqtc-qtbase | Status: NEW | 0 | 0 |
472991,8 | SQL: Make QSqlDatabase::DriverDict creation thread-safe | dev | qt/qtbase | Status: MERGED | +2 | 0 |
479728,4 | SQL: Make QSqlDatabase::DriverDict creation thread-safe | 6.5 | qt/qtbase | Status: MERGED | +2 | 0 |