fix major thinko in ArdourCanvas::Group::clear()
authorPaul Davis <paul@linuxaudiosystems.com>
Wed, 12 Feb 2014 03:49:39 +0000 (22:49 -0500)
committerPaul Davis <paul@linuxaudiosystems.com>
Wed, 12 Feb 2014 03:49:39 +0000 (22:49 -0500)
libs/canvas/group.cc

index 619444c4e6261b4841bde0f0b8370b772c788b4a..bb917503f6adbe835336014e8074681f12e979ca 100644 (file)
@@ -58,11 +58,7 @@ Group::Group (Group* parent, Duple position)
 
 Group::~Group ()
 {
-       for (list<Item*>::iterator i = _items.begin(); i != _items.end(); ++i) {
-               (*i)->unparent ();
-       }
-
-       _items.clear ();
+       clear (true);
 }
 
 /** @param area Area to draw in this group's coordinates.
@@ -219,10 +215,11 @@ Group::clear (bool with_delete)
        begin_change ();
 
        for (list<Item*>::iterator i = _items.begin(); i != _items.end(); ++i) {
+
+               (*i)->unparent ();
+
                if (with_delete) {
                        delete *i;
-               } else {
-                       (*i)->unparent ();
                }
        }