aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/core/function/CacheManager.cpp2
-rw-r--r--src/core/function/CacheManager.h2
-rw-r--r--src/core/function/GlobalSettingStation.cpp2
-rw-r--r--src/core/function/GlobalSettingStation.h2
-rw-r--r--src/core/function/basic/ChannelObject.cpp6
-rw-r--r--src/core/function/basic/SingletonStorage.cpp4
-rw-r--r--src/core/function/basic/SingletonStorage.h5
-rw-r--r--src/core/function/gpg/GpgKeyGetter.cpp2
-rw-r--r--src/core/function/gpg/GpgKeyGetter.h2
-rw-r--r--src/core/model/DataObject.cpp4
-rw-r--r--src/core/model/DataObject.h2
-rw-r--r--src/core/module/Event.cpp3
-rw-r--r--src/core/module/Event.h2
-rw-r--r--src/core/module/GlobalRegisterTable.cpp3
-rw-r--r--src/core/module/Module.cpp2
-rw-r--r--src/core/module/Module.h2
-rw-r--r--src/core/thread/TaskRunner.cpp3
-rw-r--r--src/core/thread/TaskRunner.h3
18 files changed, 26 insertions, 25 deletions
diff --git a/src/core/function/CacheManager.cpp b/src/core/function/CacheManager.cpp
index c6926c89..87fe5e7c 100644
--- a/src/core/function/CacheManager.cpp
+++ b/src/core/function/CacheManager.cpp
@@ -245,7 +245,7 @@ class CacheManager::Impl : public SingletonFunctionObject<CacheManager::Impl> {
CacheManager::CacheManager(int channel)
: SingletonFunctionObject<CacheManager>(channel),
- p_(std::make_unique<Impl>(this, channel)) {}
+ p_(SecureCreateUniqueObject<Impl>(this, channel)) {}
CacheManager::~CacheManager() = default;
diff --git a/src/core/function/CacheManager.h b/src/core/function/CacheManager.h
index 49db494e..062ff490 100644
--- a/src/core/function/CacheManager.h
+++ b/src/core/function/CacheManager.h
@@ -56,7 +56,7 @@ class GPGFRONTEND_CORE_EXPORT CacheManager
private:
class Impl;
- std::unique_ptr<Impl> p_;
+ SecureUniquePtr<Impl> p_;
};
} // namespace GpgFrontend
diff --git a/src/core/function/GlobalSettingStation.cpp b/src/core/function/GlobalSettingStation.cpp
index b54fbfd3..be500907 100644
--- a/src/core/function/GlobalSettingStation.cpp
+++ b/src/core/function/GlobalSettingStation.cpp
@@ -267,7 +267,7 @@ class GlobalSettingStation::Impl {
GlobalSettingStation::GlobalSettingStation(int channel) noexcept
: SingletonFunctionObject<GlobalSettingStation>(channel),
- p_(std::make_unique<Impl>()) {}
+ p_(SecureCreateUniqueObject<Impl>()) {}
GlobalSettingStation::~GlobalSettingStation() noexcept = default;
diff --git a/src/core/function/GlobalSettingStation.h b/src/core/function/GlobalSettingStation.h
index 66fc4b6a..cb3b4700 100644
--- a/src/core/function/GlobalSettingStation.h
+++ b/src/core/function/GlobalSettingStation.h
@@ -177,6 +177,6 @@ class GPGFRONTEND_CORE_EXPORT GlobalSettingStation
private:
class Impl;
- std::unique_ptr<Impl> p_;
+ SecureUniquePtr<Impl> p_;
};
} // namespace GpgFrontend
diff --git a/src/core/function/basic/ChannelObject.cpp b/src/core/function/basic/ChannelObject.cpp
index 3f040ca6..451f9eeb 100644
--- a/src/core/function/basic/ChannelObject.cpp
+++ b/src/core/function/basic/ChannelObject.cpp
@@ -28,9 +28,7 @@
#include "ChannelObject.h"
-#include <ostream>
#include <utility>
-#include <iostream>
namespace GpgFrontend {
@@ -39,9 +37,7 @@ ChannelObject::ChannelObject() noexcept = default;
ChannelObject::ChannelObject(int channel, std::string type)
: channel_(channel), type_(std::move(type)) {}
-ChannelObject::~ChannelObject() noexcept {
- std::cout << "deleting channel object: " << type_ << std::endl;
-}
+ChannelObject::~ChannelObject() noexcept = default;
void ChannelObject::SetChannel(int channel) { this->channel_ = channel; }
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;
diff --git a/src/core/function/basic/SingletonStorage.h b/src/core/function/basic/SingletonStorage.h
index e678fe44..0ef47443 100644
--- a/src/core/function/basic/SingletonStorage.h
+++ b/src/core/function/basic/SingletonStorage.h
@@ -34,8 +34,7 @@ namespace GpgFrontend {
class ChannelObject;
-using ChannelObjectPtr =
- std::unique_ptr<ChannelObject, SecureObjectDeleter<ChannelObject>>;
+using ChannelObjectPtr = SecureUniquePtr<ChannelObject>;
class GPGFRONTEND_CORE_EXPORT SingletonStorage {
public:
@@ -85,7 +84,7 @@ class GPGFRONTEND_CORE_EXPORT SingletonStorage {
private:
class Impl;
- std::unique_ptr<Impl> p_;
+ SecureUniquePtr<Impl> p_;
};
} // namespace GpgFrontend \ No newline at end of file
diff --git a/src/core/function/gpg/GpgKeyGetter.cpp b/src/core/function/gpg/GpgKeyGetter.cpp
index 0cd6741c..8ce3c4fa 100644
--- a/src/core/function/gpg/GpgKeyGetter.cpp
+++ b/src/core/function/gpg/GpgKeyGetter.cpp
@@ -203,7 +203,7 @@ class GpgKeyGetter::Impl : public SingletonFunctionObject<GpgKeyGetter::Impl> {
GpgKeyGetter::GpgKeyGetter(int channel)
: SingletonFunctionObject<GpgKeyGetter>(channel),
- p_(std::make_unique<Impl>(channel)) {
+ p_(SecureCreateUniqueObject<Impl>(channel)) {
SPDLOG_DEBUG("called channel: {}", channel);
}
diff --git a/src/core/function/gpg/GpgKeyGetter.h b/src/core/function/gpg/GpgKeyGetter.h
index 48ffb0fd..275de8df 100644
--- a/src/core/function/gpg/GpgKeyGetter.h
+++ b/src/core/function/gpg/GpgKeyGetter.h
@@ -108,6 +108,6 @@ class GPGFRONTEND_CORE_EXPORT GpgKeyGetter
private:
class Impl;
- std::unique_ptr<Impl> p_;
+ SecureUniquePtr<Impl> p_;
};
} // namespace GpgFrontend
diff --git a/src/core/model/DataObject.cpp b/src/core/model/DataObject.cpp
index 9b49d0d4..6fc1f353 100644
--- a/src/core/model/DataObject.cpp
+++ b/src/core/model/DataObject.cpp
@@ -54,10 +54,10 @@ class DataObject::Impl {
std::vector<std::any> params_;
};
-DataObject::DataObject() : p_(std::make_unique<Impl>()) {}
+DataObject::DataObject() : p_(SecureCreateUniqueObject<Impl>()) {}
DataObject::DataObject(std::initializer_list<std::any> i)
- : p_(std::make_unique<Impl>(i)) {}
+ : p_(SecureCreateUniqueObject<Impl>(i)) {}
DataObject::~DataObject() = default;
diff --git a/src/core/model/DataObject.h b/src/core/model/DataObject.h
index b5c4fa5a..49082d09 100644
--- a/src/core/model/DataObject.h
+++ b/src/core/model/DataObject.h
@@ -73,7 +73,7 @@ class GPGFRONTEND_CORE_EXPORT DataObject {
private:
class Impl;
- std::unique_ptr<Impl> p_;
+ SecureUniquePtr<Impl> p_;
};
template <typename... Args>
diff --git a/src/core/module/Event.cpp b/src/core/module/Event.cpp
index 3c1314fe..6bd6eae5 100644
--- a/src/core/module/Event.cpp
+++ b/src/core/module/Event.cpp
@@ -107,7 +107,8 @@ class Event::Impl {
Event::Event(const std::string& event_id,
std::initializer_list<ParameterInitializer> params,
EventCallback callback)
- : p_(std::make_unique<Impl>(event_id, params, std::move(callback))) {}
+ : p_(SecureCreateUniqueObject<Impl>(event_id, params,
+ std::move(callback))) {}
Event::~Event() = default;
diff --git a/src/core/module/Event.h b/src/core/module/Event.h
index 49ae3299..774a72d1 100644
--- a/src/core/module/Event.h
+++ b/src/core/module/Event.h
@@ -82,7 +82,7 @@ class GPGFRONTEND_CORE_EXPORT Event {
private:
class Impl;
- std::unique_ptr<Impl> p_;
+ SecureUniquePtr<Impl> p_;
};
template <typename... Args>
diff --git a/src/core/module/GlobalRegisterTable.cpp b/src/core/module/GlobalRegisterTable.cpp
index eda6c744..b9fa3a1e 100644
--- a/src/core/module/GlobalRegisterTable.cpp
+++ b/src/core/module/GlobalRegisterTable.cpp
@@ -45,7 +45,8 @@ class GlobalRegisterTable::Impl {
public:
struct RTNode {
std::optional<std::any> value = std::nullopt;
- std::unordered_map<std::string, SecureUniquePtr<RTNode>> children;
+ std::unordered_map<std::string, SecureUniquePtr<RTNode>>
+ children;
int version = 0;
const std::type_info* type = nullptr;
};
diff --git a/src/core/module/Module.cpp b/src/core/module/Module.cpp
index b19e36e4..e62d0ee7 100644
--- a/src/core/module/Module.cpp
+++ b/src/core/module/Module.cpp
@@ -85,7 +85,7 @@ class Module::Impl {
Module::Module(ModuleIdentifier id, ModuleVersion version,
ModuleMetaData meta_data)
- : p_(std::make_unique<Impl>(this, id, version, meta_data)) {}
+ : p_(SecureCreateUniqueObject<Impl>(this, id, version, meta_data)) {}
Module::~Module() = default;
diff --git a/src/core/module/Module.h b/src/core/module/Module.h
index 6cc1cc3f..fe672698 100644
--- a/src/core/module/Module.h
+++ b/src/core/module/Module.h
@@ -74,7 +74,7 @@ class GPGFRONTEND_CORE_EXPORT Module : public QObject {
private:
class Impl;
- std::unique_ptr<Impl> p_;
+ SecureUniquePtr<Impl> p_;
};
} // namespace GpgFrontend::Module \ No newline at end of file
diff --git a/src/core/thread/TaskRunner.cpp b/src/core/thread/TaskRunner.cpp
index 88913bc4..a4a97b38 100644
--- a/src/core/thread/TaskRunner.cpp
+++ b/src/core/thread/TaskRunner.cpp
@@ -84,7 +84,8 @@ class TaskRunner::Impl : public QThread {
}
};
-GpgFrontend::Thread::TaskRunner::TaskRunner() : p_(std::make_unique<Impl>()) {}
+GpgFrontend::Thread::TaskRunner::TaskRunner()
+ : p_(SecureCreateUniqueObject<Impl>()) {}
GpgFrontend::Thread::TaskRunner::~TaskRunner() {
if (p_->isRunning()) {
diff --git a/src/core/thread/TaskRunner.h b/src/core/thread/TaskRunner.h
index 8661dbd4..f70c8211 100644
--- a/src/core/thread/TaskRunner.h
+++ b/src/core/thread/TaskRunner.h
@@ -29,6 +29,7 @@
#pragma once
#include "core/GpgFrontendCore.h"
+#include "core/function/SecureMemoryAllocator.h"
namespace GpgFrontend::Thread {
@@ -102,6 +103,6 @@ class GPGFRONTEND_CORE_EXPORT TaskRunner : public QObject {
private:
class Impl;
- std::unique_ptr<Impl> p_;
+ SecureUniquePtr<Impl> p_;
};
} // namespace GpgFrontend::Thread