Quote Originally Posted by rianquinn
The weird thing is, if when the plugin is unloaded, I call QSqlDatabase::removeDatabase, I still get the error.
The only thing that comes to my mind is that QApplication instance might be destroyed before the plugin (or rather the object that was created by the plugin).

Did you check Trolltech task tracker? This might be also some bug.