diff options
author | saturneric <[email protected]> | 2023-12-16 05:53:03 +0000 |
---|---|---|
committer | saturneric <[email protected]> | 2023-12-16 05:53:03 +0000 |
commit | 37215a895a649345165027971690dfdcd9106a32 (patch) | |
tree | 7a3da4e2d59ba75b43c9927fe7a98c9b6dec5ec6 /src/core/function/basic/SingletonStorage.cpp | |
parent | fix: slove memory problem of gpg context (diff) | |
download | GpgFrontend-37215a895a649345165027971690dfdcd9106a32.tar.gz GpgFrontend-37215a895a649345165027971690dfdcd9106a32.zip |
fix: use secure memory management at impl class
Diffstat (limited to 'src/core/function/basic/SingletonStorage.cpp')
-rw-r--r-- | src/core/function/basic/SingletonStorage.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/core/function/basic/SingletonStorage.cpp b/src/core/function/basic/SingletonStorage.cpp index 73e19ddd..f6507567 100644 --- a/src/core/function/basic/SingletonStorage.cpp +++ b/src/core/function/basic/SingletonStorage.cpp @@ -31,6 +31,7 @@ #include <shared_mutex> #include "core/function/basic/ChannelObject.h" +#include "utils/MemoryUtils.h" namespace GpgFrontend { @@ -104,7 +105,8 @@ class SingletonStorage::Impl { instances_map_; ///< map of singleton instances }; -SingletonStorage::SingletonStorage() noexcept : p_(std::make_unique<Impl>()) {} +SingletonStorage::SingletonStorage() noexcept + : p_(SecureCreateUniqueObject<Impl>()) {} SingletonStorage::~SingletonStorage() = default; |