diff options
-rw-r--r-- | src/ephy-page-menu-action.c | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/src/ephy-page-menu-action.c b/src/ephy-page-menu-action.c index b97c6e23b..05efbdb6d 100644 --- a/src/ephy-page-menu-action.c +++ b/src/ephy-page-menu-action.c @@ -88,9 +88,8 @@ button_press_cb (GtkWidget *button, GdkEventButton *event, EphyPageMenuAction *a g_signal_connect (menu, "notify::visible", G_CALLBACK (visible_cb), NULL); - action->priv->menu = menu; + action->priv->menu = g_object_ref (menu); } - if (!button) { GSList *l = gtk_action_get_proxies (GTK_ACTION (action)); @@ -139,10 +138,23 @@ ephy_page_menu_action_disconnect_proxy (GtkAction *action, } static void +ephy_page_menu_action_dispose (GObject *object) +{ + EphyPageMenuActionPrivate *priv = EPHY_PAGE_MENU_ACTION (object)->priv; + + g_clear_object (&priv->menu); + + G_OBJECT_CLASS (ephy_page_menu_action_parent_class)->dispose (object); +} + +static void ephy_page_menu_action_class_init (EphyPageMenuActionClass *klass) { + GObjectClass *gobject_class = G_OBJECT_CLASS (klass); GtkActionClass *action_class = GTK_ACTION_CLASS (klass); + gobject_class->dispose = ephy_page_menu_action_dispose; + action_class->activate = ephy_page_menu_action_activate; action_class->connect_proxy = ephy_page_menu_action_connect_proxy; action_class->disconnect_proxy = ephy_page_menu_action_disconnect_proxy; |