JFJochReceiver: Fix exception handling in destructor
This commit is contained in:
@@ -624,8 +624,14 @@ void JFJochReceiverFPGA::StopReceiver() {
|
||||
}
|
||||
|
||||
JFJochReceiverFPGA::~JFJochReceiverFPGA() {
|
||||
if (measurement.valid())
|
||||
measurement.get();
|
||||
try {
|
||||
if (measurement.valid())
|
||||
measurement.get();
|
||||
} catch (const std::exception& e) {
|
||||
logger.Error("ReceiverFPGA teardown failed: {}", e.what());
|
||||
} catch (...) {
|
||||
logger.Error("ReceiverFPGA teardown failed with unknown exception");
|
||||
}
|
||||
}
|
||||
|
||||
JFJochReceiverOutput JFJochReceiverFPGA::GetFinalStatistics() const {
|
||||
|
||||
@@ -84,8 +84,14 @@ JFJochReceiverLite::JFJochReceiverLite(const DiffractionExperiment &in_experimen
|
||||
|
||||
JFJochReceiverLite::~JFJochReceiverLite() {
|
||||
cancelled = true;
|
||||
if (measurement.valid())
|
||||
measurement.get();
|
||||
try {
|
||||
if (measurement.valid())
|
||||
measurement.get();
|
||||
} catch (const std::exception& e) {
|
||||
logger.Error("ReceiverLite teardown failed: {}", e.what());
|
||||
} catch (...) {
|
||||
logger.Error("ReceiverLite teardown failed with unknown exception");
|
||||
}
|
||||
}
|
||||
|
||||
void JFJochReceiverLite::MeasurementThread() {
|
||||
|
||||
Reference in New Issue
Block a user