From f31260030b888cb10be56dcf5f81e54497741478 Mon Sep 17 00:00:00 2001 From: Dhanya Thattil Date: Thu, 1 Oct 2020 17:54:08 +0200 Subject: [PATCH] bugfix: cannot stop detector if rxr crashed --- slsDetectorSoftware/src/Module.cpp | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/slsDetectorSoftware/src/Module.cpp b/slsDetectorSoftware/src/Module.cpp index b952546dd..6bfa4ce4a 100644 --- a/slsDetectorSoftware/src/Module.cpp +++ b/slsDetectorSoftware/src/Module.cpp @@ -411,10 +411,16 @@ void Module::stopAcquisition() { // get status before stopping acquisition runStatus s = ERROR, r = ERROR; bool zmqstreaming = false; - if (shm()->useReceiverFlag && getReceiverStreaming()) { - zmqstreaming = true; - s = getRunStatus(); - r = getReceiverStatus(); + try { + if (shm()->useReceiverFlag && getReceiverStreaming()) { + zmqstreaming = true; + s = getRunStatus(); + r = getReceiverStatus(); + } + } catch (...) { + // if receiver crashed, stop detector in any case + sendToDetectorStop(F_STOP_ACQUISITION); + return; } sendToDetectorStop(F_STOP_ACQUISITION); shm()->stoppedFlag = true;