File tree Expand file tree Collapse file tree 4 files changed +430
-0
lines changed Expand file tree Collapse file tree 4 files changed +430
-0
lines changed Original file line number Diff line number Diff line change @@ -431,6 +431,7 @@ set(SOURCE_FILES_unitTest
431431 tests/test -ParserWithUserSchema.cpp
432432 tests/test -query_methods.cpp
433433 tests/test -Segment.cpp
434+ tests/test -SQLiteDB.cpp
434435 tests/test -Stopwatch.cpp
435436 tests/test -StreamingCompression.cpp
436437 tests/test -string_utils.cpp
Original file line number Diff line number Diff line change @@ -19,6 +19,15 @@ void SQLiteDB::open(string const& path) {
1919 }
2020}
2121
22+ SQLiteDB::~SQLiteDB () {
23+ if (nullptr == m_db_handle) {
24+ return ;
25+ }
26+ if (false == close ()) {
27+ SPDLOG_WARN (" Failed to close underlying SQLite database - this may cause a memory leak." );
28+ }
29+ }
30+
2231bool SQLiteDB::close () {
2332 auto return_value = sqlite3_close (m_db_handle);
2433 if (SQLITE_BUSY == return_value) {
Original file line number Diff line number Diff line change @@ -25,6 +25,9 @@ class SQLiteDB {
2525 // Constructors
2626 SQLiteDB () : m_db_handle(nullptr ) {}
2727
28+ // Destructor
29+ ~SQLiteDB ();
30+
2831 // Methods
2932 void open (std::string const & path);
3033 bool close ();
You can’t perform that action at this time.
0 commit comments