mirror of
https://github.com/pocoproject/poco.git
synced 2025-10-29 04:17:55 +01:00
fixed a memory leak when opening a SQLite database fails
This commit is contained in:
@@ -163,14 +163,15 @@ void SessionImpl::open(const std::string& connect)
|
|||||||
if (rc == SQLITE_OK) break;
|
if (rc == SQLITE_OK) break;
|
||||||
if (sw.elapsedSeconds() >= tout)
|
if (sw.elapsedSeconds() >= tout)
|
||||||
{
|
{
|
||||||
close();
|
|
||||||
Utility::throwException(_pDB, rc);
|
Utility::throwException(_pDB, rc);
|
||||||
}
|
}
|
||||||
else Thread::sleep(10);
|
Thread::sleep(10);
|
||||||
|
close();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch (SQLiteException& ex)
|
catch (SQLiteException& ex)
|
||||||
{
|
{
|
||||||
|
close();
|
||||||
throw ConnectionFailedException(ex.displayText());
|
throw ConnectionFailedException(ex.displayText());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user