# HG changeset patch # User Alain Mazy # Date 1699430142 -3600 # Node ID 1a351a14165384b4b011474d7383592a633c5693 # Parent ca9cf4d46883caf49682ccc8d789c6f3bc579247 ServerContextLock -> ServerContextReference to allow multiple plugins to use it at the same time diff -r ca9cf4d46883 -r 1a351a141653 OrthancServer/Plugins/Engine/OrthancPlugins.cpp --- a/OrthancServer/Plugins/Engine/OrthancPlugins.cpp Wed Nov 08 08:34:47 2023 +0100 +++ b/OrthancServer/Plugins/Engine/OrthancPlugins.cpp Wed Nov 08 08:55:42 2023 +0100 @@ -1491,7 +1491,7 @@ ~ServerContextReference() { boost::mutex::scoped_lock lock(mutex_); - refCount_++; + refCount_--; cond_.notify_one(); } diff -r ca9cf4d46883 -r 1a351a141653 OrthancServer/Plugins/Samples/Common/OrthancPluginCppWrapper.cpp --- a/OrthancServer/Plugins/Samples/Common/OrthancPluginCppWrapper.cpp Wed Nov 08 08:34:47 2023 +0100 +++ b/OrthancServer/Plugins/Samples/Common/OrthancPluginCppWrapper.cpp Wed Nov 08 08:55:42 2023 +0100 @@ -79,6 +79,10 @@ } } + void ResetGlobalContext() + { + globalContext_ = NULL; + } bool HasGlobalContext() { diff -r ca9cf4d46883 -r 1a351a141653 OrthancServer/Plugins/Samples/Common/OrthancPluginCppWrapper.h --- a/OrthancServer/Plugins/Samples/Common/OrthancPluginCppWrapper.h Wed Nov 08 08:34:47 2023 +0100 +++ b/OrthancServer/Plugins/Samples/Common/OrthancPluginCppWrapper.h Wed Nov 08 08:55:42 2023 +0100 @@ -137,6 +137,8 @@ void SetGlobalContext(OrthancPluginContext* context); + void ResetGlobalContext(); + bool HasGlobalContext(); OrthancPluginContext* GetGlobalContext();