Do not remove a gtk-paned's child if it is destroyed.
authorMatt Birkholz <matt@birkholz.chandler.az.us>
Wed, 19 Dec 2012 00:57:51 +0000 (17:57 -0700)
committerMatt Birkholz <matt@birkholz.chandler.az.us>
Wed, 19 Dec 2012 00:57:51 +0000 (17:57 -0700)
If it is destroyed, it has already been removed (from the list of
children).

src/gtk/gtk-widget.scm

index b144bf6616ed617de40400cd902f0d6bab20b97c..fbb4139a92c4bf2a3277cbab21269905311af1bc 100644 (file)
@@ -736,7 +736,7 @@ USA.
 (define (gtk-paned-pack1 paned child1 resize? shrink?)
   (guarantee-gtk-widget child1 'gtk-paned-pack1)
   (let ((existing (gtk-paned-get-child1 paned)))
-    (if existing
+    (if (and existing (not (gtk-widget-destroyed? existing)))
        (container-remove! paned existing)))
   (set-gtk-paned-child1! paned child1)
   (container-add! paned child1)
@@ -746,7 +746,7 @@ USA.
 (define (gtk-paned-pack2 paned child2 resize? shrink?)
   (guarantee-gtk-widget child2 'gtk-paned-pack2)
   (let ((existing (gtk-paned-get-child2 paned)))
-    (if existing
+    (if (and existing (not (gtk-widget-destroyed? existing)))
        (container-remove! paned existing)))
   (set-gtk-paned-child2! paned child2)
   (container-add! paned child2)