summaryrefslogtreecommitdiff
path: root/gtk/gtkmenufactory.c
diff options
context:
space:
mode:
authorscott <scott>1998-02-05 04:10:43 +0000
committerscott <scott>1998-02-05 04:10:43 +0000
commitd3c333373548166e1024420ddbbf802a998985fa (patch)
treec1ebae29b40285c47061fa896747ef096a99d4a3 /gtk/gtkmenufactory.c
parent9258a7aecb1dfdff5fb0c91dee4c1a9a1d3cf13c (diff)
downloadgdk-pixbuf-d3c333373548166e1024420ddbbf802a998985fa.tar.gz
Menufactory now refs&sinks its children.
--sg
Diffstat (limited to 'gtk/gtkmenufactory.c')
-rw-r--r--gtk/gtkmenufactory.c18
1 files changed, 15 insertions, 3 deletions
diff --git a/gtk/gtkmenufactory.c b/gtk/gtkmenufactory.c
index eef5c8a37..02c748c84 100644
--- a/gtk/gtkmenufactory.c
+++ b/gtk/gtkmenufactory.c
@@ -88,6 +88,9 @@ gtk_menu_factory_destroy (GtkMenuFactory *factory)
if (factory->table)
gtk_accelerator_table_unref (factory->table);
+
+ if (factory->widget)
+ gtk_widget_unref (factory->widget);
}
void
@@ -102,7 +105,11 @@ gtk_menu_factory_add_entries (GtkMenuFactory *factory,
g_return_if_fail (nentries > 0);
if (!factory->widget)
- factory->widget = gtk_menu_factory_make_widget (factory);
+ {
+ factory->widget = gtk_menu_factory_make_widget (factory);
+ gtk_widget_ref (factory->widget);
+ gtk_object_sink (GTK_OBJECT (factory->widget));
+ }
for (i = 0; i < nentries; i++)
gtk_menu_factory_create (factory, &entries[i], factory->widget, entries[i].path);
@@ -272,8 +279,13 @@ gtk_menu_factory_create (GtkMenuFactory *factory,
if (subfactory->path &&
(strcmp (subfactory->path, tmp_path) == 0))
{
- if (!subfactory->widget)
- subfactory->widget = gtk_menu_factory_make_widget (subfactory);
+ if (!subfactory->widget)
+ {
+ subfactory->widget = gtk_menu_factory_make_widget (subfactory);
+ gtk_widget_ref (subfactory->widget);
+ gtk_object_sink (GTK_OBJECT (subfactory->widget));
+ }
+
gtk_menu_factory_create (subfactory, entry, subfactory->widget, p + 1);
return;
}