mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2024-11-10 02:40:11 +00:00
menu: Guard against NULL toplevel
This can happen, as indicated by GtkMenu explicitly connecting to ::destroy of its toplevel window. Do the same thing in GtkComboBox.
This commit is contained in:
parent
1362609120
commit
d54321c1ca
@ -1384,11 +1384,14 @@ gtk_menu_detach (GtkMenu *menu)
|
||||
g_object_set_data (G_OBJECT (menu), I_(attach_data_key), NULL);
|
||||
|
||||
/* Detach the toplevel window. */
|
||||
g_signal_handlers_disconnect_by_func (toplevel,
|
||||
(gpointer) menu_toplevel_attached_to,
|
||||
menu);
|
||||
if (gtk_window_get_attached_to (toplevel) == data->attach_widget)
|
||||
gtk_window_set_attached_to (toplevel, NULL);
|
||||
if (toplevel)
|
||||
{
|
||||
g_signal_handlers_disconnect_by_func (toplevel,
|
||||
(gpointer) menu_toplevel_attached_to,
|
||||
menu);
|
||||
if (gtk_window_get_attached_to (toplevel) == data->attach_widget)
|
||||
gtk_window_set_attached_to (toplevel, NULL);
|
||||
}
|
||||
|
||||
g_signal_handlers_disconnect_by_func (data->attach_widget,
|
||||
(gpointer) attach_widget_display_changed,
|
||||
|
Loading…
Reference in New Issue
Block a user