# HG changeset patch # User Sebastien Jodogne # Date 1448294562 -3600 # Node ID 5ed8769b17f97b9ab44b49aff01bb7130b04da97 # Parent 9c2ffc4e938be31da63fe4bf396abde5fced73f7 disable worklist support if no plugin has registered callbacks diff -r 9c2ffc4e938b -r 5ed8769b17f9 OrthancServer/main.cpp --- a/OrthancServer/main.cpp Mon Nov 23 16:58:55 2015 +0100 +++ b/OrthancServer/main.cpp Mon Nov 23 17:02:42 2015 +0100 @@ -736,7 +736,8 @@ dicomServer.SetFindRequestHandlerFactory(serverFactory); #if ORTHANC_PLUGINS_ENABLED == 1 - if (plugins) + if (plugins && + plugins->HasWorklistHandler()) { dicomServer.SetWorklistRequestHandlerFactory(*plugins); } diff -r 9c2ffc4e938b -r 5ed8769b17f9 Plugins/Engine/OrthancPlugins.cpp --- a/Plugins/Engine/OrthancPlugins.cpp Mon Nov 23 16:58:55 2015 +0100 +++ b/Plugins/Engine/OrthancPlugins.cpp Mon Nov 23 17:02:42 2015 +0100 @@ -2085,14 +2085,7 @@ IWorklistRequestHandler* OrthancPlugins::ConstructWorklistRequestHandler() { - bool hasHandler; - - { - boost::recursive_mutex::scoped_lock lock(pimpl_->worklistCallbackMutex_); - hasHandler = !pimpl_->worklistCallbacks_.empty(); - } - - if (hasHandler) + if (HasWorklistHandler()) { return new WorklistHandler(*this); } @@ -2101,4 +2094,12 @@ return NULL; } } + + + bool OrthancPlugins::HasWorklistHandler() + { + boost::recursive_mutex::scoped_lock lock(pimpl_->worklistCallbackMutex_); + return !pimpl_->worklistCallbacks_.empty(); + } + } diff -r 9c2ffc4e938b -r 5ed8769b17f9 Plugins/Engine/OrthancPlugins.h --- a/Plugins/Engine/OrthancPlugins.h Mon Nov 23 16:58:55 2015 +0100 +++ b/Plugins/Engine/OrthancPlugins.h Mon Nov 23 17:02:42 2015 +0100 @@ -211,6 +211,7 @@ SignalChangeInternal(OrthancPluginChangeType_OrthancStopped, OrthancPluginResourceType_None, NULL); } + bool HasWorklistHandler(); virtual IWorklistRequestHandler* ConstructWorklistRequestHandler(); };