From what I found out, there may be two causes for that:
- QSqlDatabase::addDatabase() and QSqlDatabase::removeDatabase() are not entirely thread-safe when using MySQL driver (maybe also when using other drivers, I didn't check them)
- MySQL driver doesn't clean up properly after itself when call to QSqlDatabase::open() fails.
See my response to your bug for more details.
Bookmarks