{
stop_capture();
- _sampling_thread.join();
+ if (_sampling_thread.joinable())
+ _sampling_thread.join();
if (_dev_inst)
_device_manager.release_device(_dev_inst);
sr_session_stop();
// Check that sampling stopped
- _sampling_thread.join();
+ if (_sampling_thread.joinable())
+ _sampling_thread.join();
}
set< shared_ptr<data::SignalData> > SigSession::get_data() const