diff --git a/src/Database.cpp b/src/Database.cpp index 5367d39..38d395f 100644 --- a/src/Database.cpp +++ b/src/Database.cpp @@ -49,6 +49,10 @@ void Database::open() { std::cout << message << std::endl; } +void Database::close() { + sqlite3_close(db); +} + void Database::createTables() { char* errMsg = 0; diff --git a/src/Database.hpp b/src/Database.hpp index 3baec86..0f338a8 100644 --- a/src/Database.hpp +++ b/src/Database.hpp @@ -45,6 +45,7 @@ namespace Database { #pragma endregion DatabaseStructs void open(); + void close(); void createTables(); int getTableSize(std::string tableName); diff --git a/src/main.cpp b/src/main.cpp index aabfee3..d0b7f11 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -48,7 +48,8 @@ void terminate(int arg) { if (shardServer != nullptr && shardThread != nullptr) shardServer->kill(); - + + Database::close(); exit(0); }