# HG changeset patch # User Sebastien Jodogne # Date 1415789560 -3600 # Node ID 5bd4c9f85b4ce32bbe0448f07156d786eb8535d4 # Parent 410c27e04a23eeae829f0b4d06c5fbd94fb1f235 fix race condition while unregistering plugins diff -r 410c27e04a23 -r 5bd4c9f85b4c OrthancServer/ServerContext.h --- a/OrthancServer/ServerContext.h Tue Nov 11 09:57:42 2014 +0100 +++ b/OrthancServer/ServerContext.h Wed Nov 12 11:52:40 2014 +0100 @@ -200,6 +200,11 @@ plugins_ = &plugins; } + void ResetOrthancPlugins() + { + plugins_ = NULL; + } + bool DeleteResource(Json::Value& target, const std::string& uuid, ResourceType expectedType); diff -r 410c27e04a23 -r 5bd4c9f85b4c OrthancServer/main.cpp --- a/OrthancServer/main.cpp Tue Nov 11 09:57:42 2014 +0100 +++ b/OrthancServer/main.cpp Wed Nov 12 11:52:40 2014 +0100 @@ -586,6 +586,7 @@ LOG(WARNING) << "Orthanc is stopping"; #if ENABLE_PLUGINS == 1 + context.ResetOrthancPlugins(); orthancPlugins.Stop(); LOG(WARNING) << " Plugins have stopped"; #endif @@ -701,7 +702,7 @@ } catch (...) { - LOG(ERROR) << "Native exception, stopping now"; + LOG(ERROR) << "Native exception, stopping now. Check your plugins, if any."; status = -1; }