summaryrefslogtreecommitdiff
path: root/gtk/gtkcontainer.c
diff options
context:
space:
mode:
Diffstat (limited to 'gtk/gtkcontainer.c')
-rw-r--r--gtk/gtkcontainer.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/gtk/gtkcontainer.c b/gtk/gtkcontainer.c
index f9aaae6df4..94c201a043 100644
--- a/gtk/gtkcontainer.c
+++ b/gtk/gtkcontainer.c
@@ -221,11 +221,18 @@ gtk_container_init (GtkContainer *container)
}
static void
+gtk_container_remove_cb (GtkWidget *child,
+ GtkContainer *container)
+{
+ gtk_container_remove (container, child);
+}
+
+static void
gtk_container_dispose (GObject *object)
{
GtkContainer *container = GTK_CONTAINER (object);
- gtk_container_foreach (container, (GtkCallback) gtk_widget_destroy, NULL);
+ gtk_container_foreach (container, (GtkCallback) gtk_container_remove_cb, container);
G_OBJECT_CLASS (gtk_container_parent_class)->dispose (object);
}