From a9520520d997a08879efbf1f7169298c30b53c49 Mon Sep 17 00:00:00 2001 From: Marco Pesenti Gritti Date: Thu, 20 Nov 2003 17:07:48 +0000 Subject: Fix unrefing of context menu event 2003-11-20 Marco Pesenti Gritti * src/ephy-window.c: (show_embed_popup): Fix unrefing of context menu event --- ChangeLog | 6 ++++++ src/ephy-window.c | 19 +++---------------- 2 files changed, 9 insertions(+), 16 deletions(-) diff --git a/ChangeLog b/ChangeLog index 2a2f6f73c..62db0477d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2003-11-20 Marco Pesenti Gritti + + * src/ephy-window.c: (show_embed_popup): + + Fix unrefing of context menu event + 2003-11-20 Marco Pesenti Gritti * embed/mozilla/mozilla-embed.cpp: diff --git a/src/ephy-window.c b/src/ephy-window.c index 854b2d9c8..cb45fcaaf 100644 --- a/src/ephy-window.c +++ b/src/ephy-window.c @@ -1038,17 +1038,6 @@ popup_menu_at_coords (GtkMenu *menu, gint *x, gint *y, gboolean *push_in, *push_in = TRUE; } -static void -popup_destroy_cb (GtkWidget *widget, EphyWindow *window) -{ - EphyEmbedEvent *event; - - event = EPHY_EMBED_EVENT (g_object_get_data (G_OBJECT (window), "context_event")); - g_object_set_data (G_OBJECT (window), "context_event", NULL); - - g_object_unref (event); -} - static void show_embed_popup (EphyWindow *window, EphyTab *tab, EphyEmbedEvent *event) { @@ -1104,13 +1093,11 @@ show_embed_popup (EphyWindow *window, EphyTab *tab, EphyEmbedEvent *event) widget = gtk_ui_manager_get_widget (GTK_UI_MANAGER (window->ui_merge), popup); - g_return_if_fail (widget != NULL); - g_object_ref (event); - g_object_set_data (G_OBJECT (window), "context_event", event); - g_signal_connect (widget, "destroy", - G_CALLBACK (popup_destroy_cb), window); + g_object_set_data_full (G_OBJECT (window), "context_event", + g_object_ref (event), + (GDestroyNotify)g_object_unref); type = ephy_embed_event_get_event_type (event); if (type == EPHY_EMBED_EVENT_KEY) -- cgit v1.2.3