projects
/
pulseview.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Don't join with non-threads. Fixes 323
[pulseview.git]
/
pv
/
sigsession.cpp
diff --git
a/pv/sigsession.cpp
b/pv/sigsession.cpp
index a2f44dab1aaf01a462ef8383f83759f5b8147925..b5387877dda0a73a513f7cb5f066e030f3b17539 100644
(file)
--- a/
pv/sigsession.cpp
+++ b/
pv/sigsession.cpp
@@
-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
@@
-442,7
+444,7
@@
void SigSession::update_signals(shared_ptr<DevInst> dev_inst)
switch(probe->type) {
case SR_PROBE_LOGIC:
signal = shared_ptr<view::Signal>(
switch(probe->type) {
case SR_PROBE_LOGIC:
signal = shared_ptr<view::Signal>(
- new view::LogicSignal(
*this,
dev_inst,
+ new view::LogicSignal(dev_inst,
probe, _logic_data));
break;
probe, _logic_data));
break;
@@
-451,7
+453,7
@@
void SigSession::update_signals(shared_ptr<DevInst> dev_inst)
shared_ptr<data::Analog> data(
new data::Analog());
signal = shared_ptr<view::Signal>(
shared_ptr<data::Analog> data(
new data::Analog());
signal = shared_ptr<view::Signal>(
- new view::AnalogSignal(
*this,
dev_inst,
+ new view::AnalogSignal(dev_inst,
probe, data));
break;
}
probe, data));
break;
}
@@
-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>(
// 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
_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>(
// 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
_cur_analog_snapshots[probe] = snapshot;
// Find the annalog data associated with the probe