From f5cf83e4b3fdf1e9ae82b00f39e45e189809c419 Mon Sep 17 00:00:00 2001 From: saturneric Date: Fri, 15 Dec 2023 17:04:59 +0800 Subject: fix: slove some issues on memory and intilizations --- src/core/function/gpg/GpgContext.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/core/function/gpg/GpgContext.cpp') 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 #include +#include #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 { 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 { 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, -- cgit v1.2.3