diff options
author | saturneric <[email protected]> | 2023-12-15 09:04:59 +0000 |
---|---|---|
committer | saturneric <[email protected]> | 2023-12-15 09:04:59 +0000 |
commit | f5cf83e4b3fdf1e9ae82b00f39e45e189809c419 (patch) | |
tree | cc7d9b764b0274cfce5830e22a1ecc23678bd091 /src/core/function/gpg/GpgContext.cpp | |
parent | fix: slove issues on memory and add asan support for debug (diff) | |
download | GpgFrontend-f5cf83e4b3fdf1e9ae82b00f39e45e189809c419.tar.gz GpgFrontend-f5cf83e4b3fdf1e9ae82b00f39e45e189809c419.zip |
fix: slove some issues on memory and intilizations
Diffstat (limited to 'src/core/function/gpg/GpgContext.cpp')
-rw-r--r-- | src/core/function/gpg/GpgContext.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/core/function/gpg/GpgContext.cpp b/src/core/function/gpg/GpgContext.cpp index 0477b00a..443c139b 100644 --- a/src/core/function/gpg/GpgContext.cpp +++ b/src/core/function/gpg/GpgContext.cpp @@ -32,12 +32,12 @@ #include <gpgme.h> #include <cassert> +#include <mutex> #include "core/function/CoreSignalStation.h" #include "core/function/basic/GpgFunctionObject.h" #include "core/module/ModuleManager.h" #include "core/utils/GpgUtils.h" -#include "spdlog/spdlog.h" #include "utils/MemoryUtils.h" #ifdef _WIN32 @@ -158,6 +158,8 @@ class GpgContext::Impl : public SingletonFunctionObject<GpgContext::Impl> { gpgme_ctx_t ctx_ref_ = nullptr; ///< gpgme_ctx_t binary_ctx_ref_ = nullptr; ///< bool good_ = true; + std::mutex ctx_ref_lock_; + std::mutex binary_ctx_ref_lock_; static auto set_ctx_key_list_mode(const gpgme_ctx_t &ctx) -> bool { assert(ctx != nullptr); @@ -205,6 +207,8 @@ class GpgContext::Impl : public SingletonFunctionObject<GpgContext::Impl> { assert(CheckGpgError(err) == GPG_ERR_NO_ERROR); return CheckGpgError(err) == GPG_ERR_NO_ERROR; + + return true; } auto common_ctx_initialize(const gpgme_ctx_t &ctx, |