Skip to content

Commit

Permalink
Check whether the acquisition is still running when detructing CtCont…
Browse files Browse the repository at this point in the history
…rol and stop the aquistion accordingly.

This situation may happen when an exception is thrown from Lima and 
caught at a higher level in the application and could lead to SegFault.
  • Loading branch information
sdebionne committed Oct 20, 2020
1 parent 7f9e5d1 commit 32ee8b7
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions control/src/CtControl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -390,6 +390,14 @@ CtControl::CtControl(HwInterface *hw) :
CtControl::~CtControl()
{
DEB_DESTRUCTOR();

Status aStatus;
getStatus(aStatus);
if(aStatus.AcquisitionStatus == AcqRunning)
{
DEB_WARNING() << "Acquisition is still running, stopping acquisition";
stopAcq();
}

DEB_TRACE() << "Waiting for all threads to finish their tasks";
PoolThreadMgr& pool_thread_mgr = PoolThreadMgr::get();
Expand Down

0 comments on commit 32ee8b7

Please sign in to comment.