fix delete group signal issue when capture data is NULL

This commit is contained in:
DreamSourceLab 2015-06-24 22:30:12 +08:00
parent 297e4bde91
commit c71404a326
2 changed files with 8 additions and 5 deletions

View File

@ -652,10 +652,13 @@ void SigSession::del_group()
j++;
}
_group_data->get_snapshots().at((*i)->get_sec_index()).reset();
std::deque< boost::shared_ptr<data::GroupSnapshot> >::iterator k = _group_data->get_snapshots().begin();
k += (*i)->get_sec_index();
_group_data->get_snapshots().erase(k);
std::deque< boost::shared_ptr<data::GroupSnapshot> > &snapshots = _group_data->get_snapshots();
if (!snapshots.empty()) {
_group_data->get_snapshots().at((*i)->get_sec_index()).reset();
std::deque< boost::shared_ptr<data::GroupSnapshot> >::iterator k = snapshots.begin();
k += (*i)->get_sec_index();
_group_data->get_snapshots().erase(k);
}
(*i).reset();
i = _group_traces.erase(i);

View File

@ -1916,7 +1916,7 @@ static void receive_transfer(struct libusb_transfer *transfer)
struct sr_dev_inst *sdi = devc->cb_data;
for (l = sdi->channels; l; l = l->next) {
struct sr_channel *probe = (struct sr_channel *)l->data;
channel_cnt ++;
channel_cnt++;
channel_en_cnt += probe->enabled;
}
if (channel_en_cnt == 0)