diff options
author | Xan Lopez <xan@igalia.com> | 2012-01-17 07:30:43 +0800 |
---|---|---|
committer | Xan Lopez <xan@igalia.com> | 2012-01-17 07:31:08 +0800 |
commit | 01bddb73b6a99980148a61d621c0549739f28207 (patch) | |
tree | 43780f838bfe141d45aa3b16573fcc039d11d896 | |
parent | 9c7ecd319db94e3d382b36708abc9076ae4d9f4f (diff) | |
download | gsoc2013-epiphany-01bddb73b6a99980148a61d621c0549739f28207.tar gsoc2013-epiphany-01bddb73b6a99980148a61d621c0549739f28207.tar.gz gsoc2013-epiphany-01bddb73b6a99980148a61d621c0549739f28207.tar.bz2 gsoc2013-epiphany-01bddb73b6a99980148a61d621c0549739f28207.tar.lz gsoc2013-epiphany-01bddb73b6a99980148a61d621c0549739f28207.tar.xz gsoc2013-epiphany-01bddb73b6a99980148a61d621c0549739f28207.tar.zst gsoc2013-epiphany-01bddb73b6a99980148a61d621c0549739f28207.zip |
ephy-page-menu-action: hang on to our menu
-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; |