]> sigrok.org Git - pulseview.git/commitdiff
View: Make sure unused groups are freed
authorSoeren Apel <redacted>
Wed, 13 Apr 2016 06:29:17 +0000 (08:29 +0200)
committerSoeren Apel <redacted>
Wed, 13 Apr 2016 06:29:17 +0000 (08:29 +0200)
pv/view/view.cpp

index b877da1e202aaaeae210e7492ea151fdc0858155..8d5bd6d3ad02b836d7d5ee1f0f29e8f1cccf4a99 100644 (file)
@@ -1087,8 +1087,10 @@ void View::signals_changed()
 
        // Remove any empty trace groups
        for (shared_ptr<TraceGroup> group : list_by_type<TraceGroup>())
-               if (group->child_items().size() == 0)
+               if (group->child_items().size() == 0) {
                        remove_child_item(group);
+                       group.reset();
+               }
 
        // Add and position the pending top levels items
        for (auto item : new_top_level_items) {