diff OrthancServer/main.cpp @ 1328:b7351ecb79b4

fix in the plugin destruction
author Sebastien Jodogne <s.jodogne@gmail.com>
date Wed, 18 Feb 2015 13:06:01 +0100
parents 0f9e0e808e0f
children 111e23bb4904
line wrap: on
line diff
--- a/OrthancServer/main.cpp	Mon Feb 16 12:05:20 2015 +0100
+++ b/OrthancServer/main.cpp	Wed Feb 18 13:06:01 2015 +0100
@@ -481,7 +481,6 @@
 
 #if ENABLE_PLUGINS == 1
     orthancPlugins.SetServerContext(*context);
-    orthancPlugins.SetOrthancRestApi(restApi);
     httpServer.RegisterHandler(orthancPlugins);
     context->SetOrthancPlugins(pluginsManager, orthancPlugins);
 #endif
@@ -509,6 +508,10 @@
     // GO !!! Start the requested servers
     if (Configuration::GetGlobalBoolParameter("HttpServerEnabled", true))
     {
+#if ENABLE_PLUGINS == 1
+      orthancPlugins.SetOrthancRestApi(restApi);
+#endif
+
       httpServer.Start();
       LOG(WARNING) << "HTTP server listening on port: " << httpServer.GetPortNumber();
     }
@@ -542,6 +545,7 @@
 #if ENABLE_PLUGINS == 1
     context->ResetOrthancPlugins();
     orthancPlugins.Stop();
+    orthancPlugins.ResetOrthancRestApi();
     LOG(WARNING) << "    Plugins have stopped";
 #endif