summaryrefslogtreecommitdiff
path: root/gnuradio-runtime/lib/buffer.cc
diff options
context:
space:
mode:
Diffstat (limited to 'gnuradio-runtime/lib/buffer.cc')
-rw-r--r--gnuradio-runtime/lib/buffer.cc9
1 files changed, 5 insertions, 4 deletions
diff --git a/gnuradio-runtime/lib/buffer.cc b/gnuradio-runtime/lib/buffer.cc
index 079cfe310f..5ab8694862 100644
--- a/gnuradio-runtime/lib/buffer.cc
+++ b/gnuradio-runtime/lib/buffer.cc
@@ -251,10 +251,11 @@ namespace gr {
If this function is used elsewhere, remember to lock the
buffer's mutex al la the scoped_lock line below.
*/
- std::multimap<uint64_t, tag_t>::iterator itr = d_item_tags.lower_bound(max_time);
- while (itr != d_item_tags.end()) {
- d_item_tags.erase(itr);
- itr++;
+ std::multimap<uint64_t, tag_t>::iterator end_itr = d_item_tags.lower_bound(max_time);
+ std::multimap<uint64_t, tag_t>::iterator begin_itr = d_item_tags.begin();
+ while (begin_itr != end_itr) {
+ d_item_tags.erase(begin_itr);
+ begin_itr++;
}
}