]> sigrok.org Git - pulseview.git/commitdiff
View: Handle pre-existing trace groups correctly
authorSoeren Apel <redacted>
Thu, 7 Apr 2016 20:02:04 +0000 (22:02 +0200)
committerSoeren Apel <redacted>
Thu, 7 Apr 2016 20:02:04 +0000 (22:02 +0200)
pv/view/view.cpp

index 5649bdc849e5609dea698a21bce41b8d60102e2e..b877da1e202aaaeae210e7492ea151fdc0858155 100644 (file)
@@ -1038,13 +1038,15 @@ void View::signals_changed()
                                        offset += extents.second;
                        }
 
-                       // Assign proper vertical offsets to each channel in the group
-                       new_trace_group->restack_items();
-
-                       // If this is a new group, enqueue it in the new top level
-                       // items list
-                       if (!new_traces_in_group.empty() && new_trace_group)
-                               new_top_level_items.push_back(new_trace_group);
+                       if (new_trace_group) {
+                               // Assign proper vertical offsets to each channel in the group
+                               new_trace_group->restack_items();
+
+                               // If this is a new group, enqueue it in the new top level
+                               // items list
+                               if (!new_traces_in_group.empty())
+                                       new_top_level_items.push_back(new_trace_group);
+                       }
                }
 
        // Enqueue the remaining logic channels in a group