Skip to content

Fix abort on module destruction if module has yet to be stopped, always stop modules before shutdown

Enrico Gamberini requested to merge fix-ctrlc-abort into master

Previously in daqinterface: if a down is commanded before modules are stopped with stop, bool DAQProcess::m_run would be set while the derived module destructs, causing resources likely used by std::thread DAQProcess::m_runner_thread to be freed before the thread has joined. This is undefined behavior and caused an abort.

Now, down also implies a stop, correctly clearing m_run before the interface exits. Furthermore, a module's destructor will not be called unless m_runner_thread has joined, after which thread resources can safely be freed.

Merge request reports