2
0
forked from Ivasoft/DSView

Fix memory release issue when added protocol decoder

This commit is contained in:
DreamSourceLab
2016-03-25 14:34:06 +08:00
parent 0a6f675ff9
commit f0aff5e7ce
3 changed files with 14 additions and 11 deletions

View File

@@ -213,6 +213,8 @@ void DecoderStack::clear()
void DecoderStack::stop_decode()
{
_snapshot.reset();
if(_decode_state == Stopped)
return;

View File

@@ -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()

View File

@@ -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;
}