From 55bcf082ec44a2f7fbd9f43a58f4de2f38f54be1 Mon Sep 17 00:00:00 2001 From: "Scott E. Graves" Date: Wed, 9 Oct 2024 19:50:05 -0500 Subject: [PATCH] fixes --- repertory/librepertory/include/file_manager/file_manager.hpp | 2 +- repertory/librepertory/src/providers/meta_db.cpp | 1 + support/include/utils/db/sqlite/db_common.hpp | 5 ++--- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/repertory/librepertory/include/file_manager/file_manager.hpp b/repertory/librepertory/include/file_manager/file_manager.hpp index 56fc13b9..7469d57f 100644 --- a/repertory/librepertory/include/file_manager/file_manager.hpp +++ b/repertory/librepertory/include/file_manager/file_manager.hpp @@ -458,7 +458,7 @@ private: i_provider &provider_; private: - utils::db::sqlite::db3_t db_{nullptr}; + utils::db::sqlite::db3_t db_; std::uint64_t next_handle_{0U}; mutable std::recursive_mutex open_file_mtx_; std::unordered_map> diff --git a/repertory/librepertory/src/providers/meta_db.cpp b/repertory/librepertory/src/providers/meta_db.cpp index c68d70a2..a3cb74a0 100644 --- a/repertory/librepertory/src/providers/meta_db.cpp +++ b/repertory/librepertory/src/providers/meta_db.cpp @@ -48,6 +48,7 @@ meta_db::meta_db(const app_config &cfg) { '|' + sqlite3_errstr(res)); return; } + db_ = utils::db::sqlite::db3_t{ db3, utils::db::sqlite::sqlite3_deleter(), diff --git a/support/include/utils/db/sqlite/db_common.hpp b/support/include/utils/db/sqlite/db_common.hpp index 02d100ff..5b395709 100644 --- a/support/include/utils/db/sqlite/db_common.hpp +++ b/support/include/utils/db/sqlite/db_common.hpp @@ -39,6 +39,7 @@ using db3_t = std::unique_ptr; struct sqlite3_statement_deleter { void operator()(sqlite3_stmt *stmt) const { if (stmt != nullptr) { + std::cout << "freeing stmt" << std::endl; sqlite3_reset(stmt); sqlite3_finalize(stmt); } @@ -61,12 +62,10 @@ struct db_context_t { db_context_t(sqlite3 &db3_, std::string table_name_) : db3(db3_), table_name(std::move(table_name_)) {} - virtual ~db_context_t() = default; - sqlite3 &db3; std::string table_name; - db3_stmt_t stmt{nullptr}; + db3_stmt_t stmt; }; class db_column final {