diff options
author | Matthias Clasen <mclasen@redhat.com> | 2004-07-20 17:10:24 +0000 |
---|---|---|
committer | Matthias Clasen <matthiasc@src.gnome.org> | 2004-07-20 17:10:24 +0000 |
commit | 82877f9ee919f8a19060a219bfe5f94d8fa17f94 (patch) | |
tree | 8785e46f2285c242a12e3ba57b0424881a1ae6d0 /tests/testactions.c | |
parent | 9aeba99da095f26ba535e4b2fb0797943309a851 (diff) | |
download | gdk-pixbuf-82877f9ee919f8a19060a219bfe5f94d8fa17f94.tar.gz |
Add some refcount debugging.
2004-07-20 Matthias Clasen <mclasen@redhat.com>
* tests/testactions.c (main):
* tests/testmerge.c (main): Add some refcount debugging.
* gtk/gtkuimanager.c (update_node, free_node): Ref an sink
all proxies, so that we can properly clean up floating proxies
which the app didn't adopt. (#147926, Tommi Komulainen)
Diffstat (limited to 'tests/testactions.c')
-rw-r--r-- | tests/testactions.c | 26 |
1 files changed, 24 insertions, 2 deletions
diff --git a/tests/testactions.c b/tests/testactions.c index be8c78a28..3c9a50789 100644 --- a/tests/testactions.c +++ b/tests/testactions.c @@ -203,7 +203,12 @@ static const gchar *ui_info = " <toolitem name=\"justify-fill\" action=\"justify-fill\" />\n" " <separator name=\"sep11\"/>\n" " <toolitem name=\"quit\" action=\"quit\" />\n" -" </toolbar>\n"; +" </toolbar>\n" +" <popup name=\"popup\">\n" +" <menuitem name=\"popcut\" action=\"cut\" />\n" +" <menuitem name=\"popcopy\" action=\"copy\" />\n" +" <menuitem name=\"poppaste\" action=\"paste\" />\n" +" </popup>\n"; static void add_widget (GtkUIManager *merge, @@ -308,16 +313,18 @@ create_window (GtkActionGroup *action_group) GtkWidget *hbox, *spinbutton, *button; GError *error = NULL; + merge = gtk_ui_manager_new (); + window = gtk_window_new (GTK_WINDOW_TOPLEVEL); gtk_window_set_default_size (GTK_WINDOW (window), -1, -1); gtk_window_set_title (GTK_WINDOW (window), "Action Test"); + g_signal_connect_swapped (window, "destroy", G_CALLBACK (g_object_unref), merge); g_signal_connect (window, "destroy", G_CALLBACK (gtk_main_quit), NULL); box = gtk_vbox_new (FALSE, 0); gtk_container_add (GTK_CONTAINER (window), box); gtk_widget_show (box); - merge = gtk_ui_manager_new (); gtk_ui_manager_insert_action_group (merge, action_group, 0); g_signal_connect (merge, "add_widget", G_CALLBACK (add_widget), box); @@ -382,6 +389,21 @@ main (int argc, char **argv) gtk_main (); +#ifdef DEBUG_UI_MANAGER + { + GList *action; + + for (action = gtk_action_group_list_actions (action_group); + action; + action = action->next) + { + GtkAction *a = action->data; + g_print ("action %s ref count %d\n", + gtk_action_get_name (a), G_OBJECT (a)->ref_count); + } + } +#endif + g_object_unref (action_group); gtk_accel_map_save ("accels"); |