Mercurial > hg > orthanc-dicomweb
changeset 755:161293383661
removed call to virtual method in destructor
| author | Sebastien Jodogne <s.jodogne@gmail.com> |
|---|---|
| date | Tue, 14 Apr 2026 15:48:07 +0200 |
| parents | d7c34b3f0b51 |
| children | f24b8e529ea3 |
| files | Plugin/DicomWebClient.cpp |
| diffstat | 1 files changed, 32 insertions(+), 28 deletions(-) [+] |
line wrap: on
line diff
--- a/Plugin/DicomWebClient.cpp Tue Apr 14 15:43:04 2026 +0200 +++ b/Plugin/DicomWebClient.cpp Tue Apr 14 15:48:07 2026 +0200 @@ -219,6 +219,33 @@ } } + void StopInternal(OrthancPluginJobStopReason reason) + { + if (factory_ == NULL) + { + return; + } + else if (reason == OrthancPluginJobStopReason_Paused || + reason == OrthancPluginJobStopReason_Canceled) + { + stopping_ = true; + + if (reason == OrthancPluginJobStopReason_Paused) + { + factory_->PauseFunction(); + } + else + { + factory_->CancelFunction(); + } + + JoinWorker(); + + // Be ready for the next possible call to "Step()" that will resume the function + functionResult_ = FunctionResult_Running; + } + } + public: explicit SingleFunctionJob(const std::string& jobName) : OrthancJob(jobName), @@ -243,14 +270,14 @@ { try { - Stop(OrthancPluginJobStopReason_Canceled); + StopInternal(OrthancPluginJobStopReason_Canceled); } catch (Orthanc::OrthancException&) { } } - virtual OrthancPluginJobStepStatus Step() ORTHANC_OVERRIDE + virtual OrthancPluginJobStepStatus Step() ORTHANC_OVERRIDE ORTHANC_FINAL { if (factory_ == NULL) { @@ -284,34 +311,12 @@ } } - virtual void Stop(OrthancPluginJobStopReason reason) ORTHANC_OVERRIDE + virtual void Stop(OrthancPluginJobStopReason reason) ORTHANC_OVERRIDE ORTHANC_FINAL { - if (factory_ == NULL) - { - return; - } - else if (reason == OrthancPluginJobStopReason_Paused || - reason == OrthancPluginJobStopReason_Canceled) - { - stopping_ = true; - - if (reason == OrthancPluginJobStopReason_Paused) - { - factory_->PauseFunction(); - } - else - { - factory_->CancelFunction(); - } - - JoinWorker(); - - // Be ready for the next possible call to "Step()" that will resume the function - functionResult_ = FunctionResult_Running; - } + StopInternal(reason); } - virtual void Reset() ORTHANC_OVERRIDE + virtual void Reset() ORTHANC_OVERRIDE ORTHANC_FINAL { boost::mutex::scoped_lock lock(mutex_); @@ -847,7 +852,6 @@ { debug_ = debug; } - };
