# HG changeset patch # User Sebastien Jodogne # Date 1435845549 -7200 # Node ID 040d58493998e6054ccda780d9bb64e16986bafb # Parent 1d109322f5d3f7781ad613d2b7a31f0c25479197 security diff -r 1d109322f5d3 -r 040d58493998 OrthancServer/ServerContext.cpp --- a/OrthancServer/ServerContext.cpp Thu Jul 02 15:45:55 2015 +0200 +++ b/OrthancServer/ServerContext.cpp Thu Jul 02 15:59:09 2015 +0200 @@ -132,6 +132,11 @@ { if (!done_) { + { + boost::recursive_mutex::scoped_lock lock(listenersMutex_); + listeners_.clear(); + } + done_ = true; if (changeThread_.joinable()) @@ -436,10 +441,11 @@ void ServerContext::SetPlugins(OrthancPlugins& plugins) { + boost::recursive_mutex::scoped_lock lock(listenersMutex_); + plugins_ = &plugins; // TODO REFACTOR THIS - boost::recursive_mutex::scoped_lock lock(listenersMutex_); listeners_.clear(); listeners_.push_back(ServerListener(lua_, "Lua")); listeners_.push_back(ServerListener(plugins, "plugin")); @@ -448,10 +454,11 @@ void ServerContext::ResetPlugins() { + boost::recursive_mutex::scoped_lock lock(listenersMutex_); + plugins_ = NULL; // TODO REFACTOR THIS - boost::recursive_mutex::scoped_lock lock(listenersMutex_); listeners_.clear(); listeners_.push_back(ServerListener(lua_, "Lua")); }