From 49580a45a618c6992b19988714d80f6f909095be Mon Sep 17 00:00:00 2001 From: Xan Lopez Date: Tue, 17 Jan 2012 19:57:50 +0100 Subject: ephy-page-menu-action: do not query the action proxies during dispose That was a bad idea. Just store the proxy used for the visibility hack in the private data too. --- src/ephy-page-menu-action.c | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) (limited to 'src/ephy-page-menu-action.c') diff --git a/src/ephy-page-menu-action.c b/src/ephy-page-menu-action.c index b42d13c21..3faddd215 100644 --- a/src/ephy-page-menu-action.c +++ b/src/ephy-page-menu-action.c @@ -27,6 +27,7 @@ G_DEFINE_TYPE (EphyPageMenuAction, ephy_page_menu_action, EPHY_TYPE_WINDOW_ACTIO struct _EphyPageMenuActionPrivate { GtkWidget *menu; + GtkWidget *button; }; static void @@ -101,6 +102,7 @@ button_press_cb (GtkWidget *button, GdkEventButton *event, EphyPageMenuAction *a G_CALLBACK (visible_cb), button); action->priv->menu = g_object_ref (menu); + action->priv->button = g_object_ref (button); } if (event) { @@ -146,17 +148,11 @@ ephy_page_menu_action_dispose (GObject *object) { EphyPageMenuActionPrivate *priv = EPHY_PAGE_MENU_ACTION (object)->priv; - if (priv->menu) { - GtkWidget *button = NULL; - GSList *l = gtk_action_get_proxies (GTK_ACTION (object)); - - if (GTK_IS_BUTTON (l->data)) - button = GTK_WIDGET (l->data); - - g_signal_handlers_disconnect_by_func (priv->menu, G_CALLBACK (visible_cb), button); - } + if (priv->menu) + g_signal_handlers_disconnect_by_func (priv->menu, G_CALLBACK (visible_cb), priv->button); g_clear_object (&priv->menu); + g_clear_object (&priv->button); G_OBJECT_CLASS (ephy_page_menu_action_parent_class)->dispose (object); } -- cgit