Close DB properly

This commit is contained in:
Kamil 2020-12-04 01:22:53 +01:00 committed by Gent S
parent 889fc985c4
commit 3e855cbdac
3 changed files with 7 additions and 1 deletions

View File

@ -49,6 +49,10 @@ void Database::open() {
std::cout << message << std::endl;
}
void Database::close() {
sqlite3_close(db);
}
void Database::createTables() {
char* errMsg = 0;

View File

@ -45,6 +45,7 @@ namespace Database {
#pragma endregion DatabaseStructs
void open();
void close();
void createTables();
int getTableSize(std::string tableName);

View File

@ -48,7 +48,8 @@ void terminate(int arg) {
if (shardServer != nullptr && shardThread != nullptr)
shardServer->kill();
Database::close();
exit(0);
}