(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)
(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)