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
This commit is contained in:
Daniel Boles 2018-04-22 16:25:07 +01:00
parent 2ba118c961
commit db85e888c7

View File

@ -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);
}