]> sigrok.org Git - pulseview.git/blobdiff - pv/sigsession.cpp
Don't join with non-threads. Fixes 323
[pulseview.git] / pv / sigsession.cpp
index 10ea4ffbea6dc1ad4e171b9054289e938fad66f0..b5387877dda0a73a513f7cb5f066e030f3b17539 100644 (file)
@@ -75,7 +75,8 @@ SigSession::~SigSession()
 {
        stop_capture();
 
 {
        stop_capture();
 
-       _sampling_thread.join();
+       if (_sampling_thread.joinable())
+               _sampling_thread.join();
 
        if (_dev_inst)
                _device_manager.release_device(_dev_inst);
 
        if (_dev_inst)
                _device_manager.release_device(_dev_inst);
@@ -200,7 +201,8 @@ void SigSession::stop_capture()
        sr_session_stop();
 
        // Check that sampling stopped
        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
 }
 
 set< shared_ptr<data::SignalData> > SigSession::get_data() const