aboutsummaryrefslogtreecommitdiff
path: root/src/crepe/manager/SaveManager.cpp
diff options
context:
space:
mode:
authorLoek Le Blansch <loek@pipeframe.xyz>2024-12-10 20:10:58 +0100
committerLoek Le Blansch <loek@pipeframe.xyz>2024-12-10 20:10:58 +0100
commit8ed0c3f425b02d4f064c455270288a6c4a359109 (patch)
treec928eb4ca6ff61bc7c86888a35afc7d67bdef39c /src/crepe/manager/SaveManager.cpp
parent4414fe5079b44d5bbcbba89bb1e71ce01b949226 (diff)
use opaque type instead of forward declared DB for unique_ptr in SaveManager
Diffstat (limited to 'src/crepe/manager/SaveManager.cpp')
-rw-r--r--src/crepe/manager/SaveManager.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/crepe/manager/SaveManager.cpp b/src/crepe/manager/SaveManager.cpp
index 292e8fd..39b92d4 100644
--- a/src/crepe/manager/SaveManager.cpp
+++ b/src/crepe/manager/SaveManager.cpp
@@ -14,9 +14,12 @@ SaveManager::SaveManager(Mediator & mediator) : Manager(mediator) {
DB & SaveManager::get_db() {
if (this->db == nullptr) {
Config & cfg = Config::get_instance();
- this->db = make_unique<DB>(cfg.savemgr.location);
+ this->db = {
+ new DB(cfg.savemgr.location),
+ [](void * db){ delete static_cast<DB *>(db); }
+ };
}
- return *this->db;
+ return *static_cast<DB *>(this->db.get());
}
template <>