-
Notifications
You must be signed in to change notification settings - Fork 7
Description
in ConnectionPrivate::ConnectionPrivate , this->db = QSqlDatabase::addDatabase(config.driver, dbId); will add different ID database. when refresh , sometime, a new sharedPtr will replace the older one. But no QSqlDatabase::removeDatabase in found either in the deconstructor nor the other place. I think this may lead to a memory leak .
In ConnectionPrivate::ConnectionPrivate, the code calls:
this->db = QSqlDatabase::addDatabase(config.driver, dbId);This creates database connections with different identifiers. However, during refreshoperations, a new shared pointer sometimes replaces the old connection without proper cleanup.The destructor and other code locations lack calls to QSqlDatabase::removeDatabase for the old connections. This oversight may lead to accumulated database connections and potential memory leaks over time, as orphaned QSqlDatabase objects are not properly released.