comparison 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
comparison
equal deleted inserted replaced
1327:6ed49334d5c1 1328:b7351ecb79b4
479 FilesystemHttpHandler staticResources("/app", ORTHANC_PATH "/OrthancExplorer"); 479 FilesystemHttpHandler staticResources("/app", ORTHANC_PATH "/OrthancExplorer");
480 #endif 480 #endif
481 481
482 #if ENABLE_PLUGINS == 1 482 #if ENABLE_PLUGINS == 1
483 orthancPlugins.SetServerContext(*context); 483 orthancPlugins.SetServerContext(*context);
484 orthancPlugins.SetOrthancRestApi(restApi);
485 httpServer.RegisterHandler(orthancPlugins); 484 httpServer.RegisterHandler(orthancPlugins);
486 context->SetOrthancPlugins(pluginsManager, orthancPlugins); 485 context->SetOrthancPlugins(pluginsManager, orthancPlugins);
487 #endif 486 #endif
488 487
489 httpServer.RegisterHandler(staticResources); 488 httpServer.RegisterHandler(staticResources);
507 506
508 507
509 // GO !!! Start the requested servers 508 // GO !!! Start the requested servers
510 if (Configuration::GetGlobalBoolParameter("HttpServerEnabled", true)) 509 if (Configuration::GetGlobalBoolParameter("HttpServerEnabled", true))
511 { 510 {
511 #if ENABLE_PLUGINS == 1
512 orthancPlugins.SetOrthancRestApi(restApi);
513 #endif
514
512 httpServer.Start(); 515 httpServer.Start();
513 LOG(WARNING) << "HTTP server listening on port: " << httpServer.GetPortNumber(); 516 LOG(WARNING) << "HTTP server listening on port: " << httpServer.GetPortNumber();
514 } 517 }
515 else 518 else
516 { 519 {
540 LOG(WARNING) << "Orthanc is stopping"; 543 LOG(WARNING) << "Orthanc is stopping";
541 544
542 #if ENABLE_PLUGINS == 1 545 #if ENABLE_PLUGINS == 1
543 context->ResetOrthancPlugins(); 546 context->ResetOrthancPlugins();
544 orthancPlugins.Stop(); 547 orthancPlugins.Stop();
548 orthancPlugins.ResetOrthancRestApi();
545 LOG(WARNING) << " Plugins have stopped"; 549 LOG(WARNING) << " Plugins have stopped";
546 #endif 550 #endif
547 551
548 dicomServer.Stop(); 552 dicomServer.Stop();
549 LOG(WARNING) << " DICOM server has stopped"; 553 LOG(WARNING) << " DICOM server has stopped";