aboutsummaryrefslogtreecommitdiffstats
path: root/src/core/utils/MemoryUtils.h
diff options
context:
space:
mode:
authorsaturneric <[email protected]>2025-04-17 15:28:04 +0000
committersaturneric <[email protected]>2025-04-17 15:28:04 +0000
commite276f9e86b161362d6f379ab790476936a0e6208 (patch)
tree65c27e3efcbf113a052bc053e1c2739f4a351217 /src/core/utils/MemoryUtils.h
parentfix: compiler issues on CI (diff)
downloadGpgFrontend-e276f9e86b161362d6f379ab790476936a0e6208.tar.gz
GpgFrontend-e276f9e86b161362d6f379ab790476936a0e6208.zip
feat: generate cark keys
Diffstat (limited to 'src/core/utils/MemoryUtils.h')
-rw-r--r--src/core/utils/MemoryUtils.h19
1 files changed, 1 insertions, 18 deletions
diff --git a/src/core/utils/MemoryUtils.h b/src/core/utils/MemoryUtils.h
index 223c6f82..6c2bb69f 100644
--- a/src/core/utils/MemoryUtils.h
+++ b/src/core/utils/MemoryUtils.h
@@ -143,24 +143,7 @@ static auto SecureCreateUniqueObject(Args &&...args)
}
template <typename T, typename... Args>
-auto SecureCreateSharedObject(Args &&...args) -> std::shared_ptr<T> {
- void *mem = SecureMemoryAllocator::Allocate(sizeof(T));
- if (!mem) throw std::bad_alloc();
-
- try {
- T *obj = new (mem) T(std::forward<Args>(args)...);
- return std::shared_ptr<T>(obj, [](T *ptr) {
- ptr->~T();
- SecureMemoryAllocator::Deallocate(ptr);
- });
- } catch (...) {
- SecureMemoryAllocator::Deallocate(mem);
- throw;
- }
-}
-
-template <typename T, typename... Args>
-auto SecureCreateQSharedObject(Args &&...args) -> QSharedPointer<T> {
+auto SecureCreateSharedObject(Args &&...args) -> QSharedPointer<T> {
void *mem = SecureMemoryAllocator::Allocate(sizeof(T));
if (!mem) throw std::bad_alloc();