]> sigrok.org Git - pulseview.git/blobdiff - pv/sigsession.cpp
Don't join with non-threads. Fixes 323
[pulseview.git] / pv / sigsession.cpp
index 5da1551fc51cee4e1e5e3f539654359280933c37..b5387877dda0a73a513f7cb5f066e030f3b17539 100644 (file)
@@ -75,7 +75,8 @@ SigSession::~SigSession()
 {
        stop_capture();
 
-       _sampling_thread.join();
+       if (_sampling_thread.joinable())
+               _sampling_thread.join();
 
        if (_dev_inst)
                _device_manager.release_device(_dev_inst);
@@ -200,7 +201,8 @@ void SigSession::stop_capture()
        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
@@ -645,7 +647,7 @@ void SigSession::feed_in_logic(const sr_datafeed_logic &logic)
 
                // Create a new data snapshot
                _cur_logic_snapshot = shared_ptr<data::LogicSnapshot>(
-                       new data::LogicSnapshot(logic));
+                       new data::LogicSnapshot(logic, _dev_inst->get_sample_limit()));
                _logic_data->push_snapshot(_cur_logic_snapshot);
        }
        else
@@ -687,7 +689,7 @@ void SigSession::feed_in_analog(const sr_datafeed_analog &analog)
 
                        // Create a snapshot, keep it in the maps of probes
                        snapshot = shared_ptr<data::AnalogSnapshot>(
-                               new data::AnalogSnapshot());
+                               new data::AnalogSnapshot(_dev_inst->get_sample_limit()));
                        _cur_analog_snapshots[probe] = snapshot;
 
                        // Find the annalog data associated with the probe