Skip to content

Commit

Permalink
updated
Browse files Browse the repository at this point in the history
  • Loading branch information
treefrogframework committed Dec 9, 2023
1 parent d3212a6 commit 88b9957
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 7 deletions.
1 change: 0 additions & 1 deletion src/tsqldatabase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,6 @@ TSqlDatabase::DbmsType TSqlDatabase::dbmsType() const

void TSqlDatabase::setDriverExtension(TSqlDriverExtension *extension)
{
Q_ASSERT(!_driverExtension);
_driverExtension = extension;
}

Expand Down
13 changes: 8 additions & 5 deletions src/tsqldatabasepool.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -304,13 +304,16 @@ bool TSqlDatabasePool::openDatabase(TSqlDatabase &database)
{
bool ret = database.sqlDatabase().open();

TSqlDriverExtension *extension = database.driverExtension();
if (extension) {
TSqlDriverExtensionFactory::destroy(database.sqlDatabase().driverName(), extension);
if (ret) {
TSqlDriverExtension *extension = database.driverExtension();
if (extension) {
TSqlDriverExtensionFactory::destroy(database.sqlDatabase().driverName(), extension);
}

extension = TSqlDriverExtensionFactory::create(database.sqlDatabase().driverName(), database.sqlDatabase().driver());
database.setDriverExtension(extension);
}

extension = TSqlDriverExtensionFactory::create(database.sqlDatabase().driverName(), database.sqlDatabase().driver());
database.setDriverExtension(extension);
return ret;
}

Expand Down
1 change: 0 additions & 1 deletion src/tsqldatabasepool.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ class T_CORE_EXPORT TSqlDatabasePool : public QObject {
protected:
void init();
void timerEvent(QTimerEvent *event);
//void closeDatabase(QSqlDatabase &database);

private:
bool openDatabase(TSqlDatabase &database);
Expand Down

0 comments on commit 88b9957

Please sign in to comment.