[gtk/gtk-3-22] MenuButton: Disconnect newly added signal handler
- From: Daniel Boles <dboles src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/gtk-3-22] MenuButton: Disconnect newly added signal handler
- Date: Sun, 22 Apr 2018 15:35:28 +0000 (UTC)
commit db85e888c771b358dc53ce66524652d98db32e05
Author: Daniel Boles <dboles src gmail com>
Date: Sun Apr 22 16:25:07 2018 +0100
MenuButton: Disconnect newly added signal handler
Otherwise, we do stuff we shouldn't, as the failing pipeline showed:
https://gitlab.gnome.org/GNOME/gtk/pipelines/9431
https://gitlab.gnome.org/GNOME/gtk/issues/199
gtk/gtkmenubutton.c | 18 ++++++++++++------
1 file changed, 12 insertions(+), 6 deletions(-)
---
diff --git a/gtk/gtkmenubutton.c b/gtk/gtkmenubutton.c
index 941e47348f..a1264fd443 100644
--- a/gtk/gtkmenubutton.c
+++ b/gtk/gtkmenubutton.c
@@ -968,6 +968,12 @@ update_popover_direction (GtkMenuButton *menu_button)
}
}
+static void
+popover_destroy_cb (GtkMenuButton *menu_button)
+{
+ gtk_menu_button_set_popover (menu_button, NULL);
+}
+
/**
* gtk_menu_button_set_direction:
* @menu_button: a #GtkMenuButton
@@ -1043,6 +1049,9 @@ gtk_menu_button_dispose (GObject *object)
if (priv->popover)
{
+ g_signal_handlers_disconnect_by_func (priv->popover,
+ popover_destroy_cb,
+ object);
gtk_popover_set_relative_to (GTK_POPOVER (priv->popover), NULL);
priv->popover = NULL;
}
@@ -1111,12 +1120,6 @@ gtk_menu_button_get_use_popover (GtkMenuButton *menu_button)
return menu_button->priv->use_popover;
}
-static void
-popover_destroy_cb (GtkMenuButton *menu_button)
-{
- gtk_menu_button_set_popover (menu_button, NULL);
-}
-
/**
* gtk_menu_button_set_popover:
* @menu_button: a #GtkMenuButton
@@ -1151,6 +1154,9 @@ gtk_menu_button_set_popover (GtkMenuButton *menu_button,
g_signal_handlers_disconnect_by_func (priv->popover,
menu_deactivate_cb,
menu_button);
+ g_signal_handlers_disconnect_by_func (priv->popover,
+ popover_destroy_cb,
+ menu_button);
gtk_popover_set_relative_to (GTK_POPOVER (priv->popover), NULL);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]