Details
-
Bug
-
Resolution: Done
-
P4: Low
-
None
-
5.2.0, 5.3.0 Beta1
-
None
-
Debian Wheezy and Mageia 4 Linux
-
452ad2bb1358ad5206440457fecbac92779dc680
Description
Hi all
I have a very weird problem with crash after calling QSqlDatabase::close().
This is what I found:
I've a QSqlDatabase object hold in an object. This object is hold in std::unique_ptr. I use this QSqlDatabase to talk with MySQL server.
When the application is being closed, and my object with QSqlDatabase object is being destroyed - a close() in QSqlDatabase is being called. This causes a crash.
The problem is that inside of QSqlDatabase::close() a close() on driver is being called, but plugin with mysql driver was already unloaded! So implementation of driver refers to invalid memory.
Gdb shows, that mysql plugin is being unloaded on application close, while some of the objects refering to it were not destroyed yet.
I've tried to reproduce it on a smaller example without succeed.
I could reproduce the problem on two machines (Mageia 4 Linux and Debian Wheezy).