mirror of
https://github.com/edu4rdshl/gnome-shell.git
synced 2026-07-18 07:34:54 +00:00
tray: Ensure tray children are disposed when unmanaging tray
These might survive, trigger signals and crashes. Dispose the tray children and disconnect any remaining signals in order to avoid that. Closes: https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/6465 Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2669>
This commit is contained in:
parent
ef7a6294be
commit
8067065687
1 changed files with 13 additions and 0 deletions
|
|
@ -490,6 +490,8 @@ static void
|
|||
na_tray_manager_unmanage (NaTrayManager *manager)
|
||||
{
|
||||
Display *xdisplay;
|
||||
NaTrayChild *child;
|
||||
GHashTableIter iter;
|
||||
|
||||
if (manager->window == None)
|
||||
return;
|
||||
|
|
@ -510,6 +512,17 @@ na_tray_manager_unmanage (NaTrayManager *manager)
|
|||
|
||||
XDestroyWindow (xdisplay, manager->window);
|
||||
manager->window = None;
|
||||
|
||||
g_hash_table_iter_init (&iter, manager->children);
|
||||
|
||||
while (g_hash_table_iter_next (&iter, NULL, (gpointer *) &child))
|
||||
{
|
||||
g_signal_handlers_disconnect_by_func (child,
|
||||
na_tray_manager_plug_removed,
|
||||
manager);
|
||||
g_hash_table_iter_remove (&iter);
|
||||
g_object_unref (child);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue