forked from Ivasoft/DSView
Fix memory release issue when added protocol decoder
This commit is contained in:
@@ -213,6 +213,8 @@ void DecoderStack::clear()
|
||||
|
||||
void DecoderStack::stop_decode()
|
||||
{
|
||||
_snapshot.reset();
|
||||
|
||||
if(_decode_state == Stopped)
|
||||
return;
|
||||
|
||||
|
||||
@@ -103,10 +103,10 @@ int ProtocolDock::decoder_name_cmp(const void *a, const void *b)
|
||||
|
||||
void ProtocolDock::paintEvent(QPaintEvent *)
|
||||
{
|
||||
QStyleOption opt;
|
||||
opt.init(this);
|
||||
QPainter p(this);
|
||||
style()->drawPrimitive(QStyle::PE_Widget, &opt, &p, this);
|
||||
//QStyleOption opt;
|
||||
//opt.init(this);
|
||||
//QPainter p(this);
|
||||
//style()->drawPrimitive(QStyle::PE_Widget, &opt, &p, this);
|
||||
}
|
||||
|
||||
void ProtocolDock::add_protocol()
|
||||
|
||||
@@ -608,6 +608,13 @@ void SigSession::read_sample_rate(const sr_dev_inst *const sdi)
|
||||
|
||||
void SigSession::feed_in_header(const sr_dev_inst *sdi)
|
||||
{
|
||||
#ifdef ENABLE_DECODE
|
||||
for (vector< boost::shared_ptr<view::DecodeTrace> >::iterator i =
|
||||
_decode_traces.begin();
|
||||
i != _decode_traces.end();
|
||||
i++)
|
||||
(*i)->decoder()->stop_decode();
|
||||
#endif
|
||||
read_sample_rate(sdi);
|
||||
//receive_data(0);
|
||||
}
|
||||
@@ -1098,13 +1105,7 @@ void SigSession::data_feed_in(const struct sr_dev_inst *sdi,
|
||||
_cur_dso_snapshot.reset();
|
||||
_cur_analog_snapshot.reset();
|
||||
}
|
||||
#ifdef ENABLE_DECODE
|
||||
for (vector< boost::shared_ptr<view::DecodeTrace> >::iterator i =
|
||||
_decode_traces.begin();
|
||||
i != _decode_traces.end();
|
||||
i++)
|
||||
(*i)->decoder()->stop_decode();
|
||||
#endif
|
||||
|
||||
frame_ended();
|
||||
break;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user