* Close the database before the destructor runs.
This commit is contained in:
parent
fa95f4be3f
commit
d822bf32e4
4 changed files with 15 additions and 0 deletions
|
|
@ -278,6 +278,8 @@ void Database::close()
|
|||
} catch (DbException e) { rethrow(e); }
|
||||
|
||||
delete env;
|
||||
|
||||
env = 0;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -136,6 +136,13 @@ void initDB()
|
|||
}
|
||||
|
||||
|
||||
void closeDB()
|
||||
{
|
||||
/* If the database isn't open, this is a NOP. */
|
||||
nixDB.close();
|
||||
}
|
||||
|
||||
|
||||
void createStoreTransaction(Transaction & txn)
|
||||
{
|
||||
Transaction txn2(nixDB);
|
||||
|
|
|
|||
|
|
@ -49,6 +49,9 @@ void openDB(bool reserveSpace = true);
|
|||
/* Create the required database tables. */
|
||||
void initDB();
|
||||
|
||||
/* Close the database. */
|
||||
void closeDB();
|
||||
|
||||
/* Get a transaction object. */
|
||||
void createStoreTransaction(Transaction & txn);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue