From abad89cbb44744d02964eb3d3a56f7227dc7e5cf Mon Sep 17 00:00:00 2001 From: lonkaars Date: Sun, 25 Dec 2022 23:12:51 +0100 Subject: fix segfault by refactor --- oop2eindopdr/CacheManager.cpp | 1 + oop2eindopdr/CacheManager.h | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) (limited to 'oop2eindopdr') diff --git a/oop2eindopdr/CacheManager.cpp b/oop2eindopdr/CacheManager.cpp index ff996af..c335de3 100644 --- a/oop2eindopdr/CacheManager.cpp +++ b/oop2eindopdr/CacheManager.cpp @@ -8,6 +8,7 @@ #include #include +CacheManager::CacheManager(const char* cache_path) : CacheManager(std::string(cache_path)) { } CacheManager::CacheManager(std::string cache_path) { this->cache_path = cache_path; this->verify_cache(); diff --git a/oop2eindopdr/CacheManager.h b/oop2eindopdr/CacheManager.h index 2aa8a39..a4f6958 100644 --- a/oop2eindopdr/CacheManager.h +++ b/oop2eindopdr/CacheManager.h @@ -36,8 +36,8 @@ private: virtual void retry_if(std::string label, std::function action, std::function retry_if) { retry(label, true, action, retry_if); }; public: /** @brief initialize CacheManager class at `cache_path` */ + CacheManager(const char* cache_path); CacheManager(std::string cache_path); - CacheManager(const char* cache_path) { CacheManager(std::string(cache_path)); }; /** @brief close cache */ virtual ~CacheManager(); /** @brief create cache folder structure */ -- cgit v1.2.3