Commit 66630993 authored by Guido Gunther's avatar Guido Gunther
Browse files

gnome-shell-manager: Properly free grabbed keybindings



We shouldn't remove elements form the GList of keys while looping over
it. Fixing this makes sure we actually fee the entries (and is less
code).
Signed-off-by: Guido Gunther's avatarGuido Günther <guido.gunther@puri.sm>
parent 40ac7be4
......@@ -603,20 +603,10 @@ static void
phosh_gnome_shell_manager_dispose (GObject *object)
{
PhoshGnomeShellManager *self = PHOSH_GNOME_SHELL_MANAGER (object);
GList *grabbed;
guint n = 0;
g_clear_handle_id (&self->dbus_name_id, g_bus_unown_name);
for (grabbed = g_hash_table_get_keys (self->info_by_action); grabbed != NULL; grabbed = grabbed->next) {
AcceleratorInfo *info = grabbed->data;
g_hash_table_remove (self->info_by_action, GUINT_TO_POINTER (info->action_id));
++n;
}
g_hash_table_unref (self->info_by_action);
g_debug ("%d accelerators needed to be cleaned up!", n);
g_clear_pointer (&self->info_by_action, g_hash_table_unref);
G_OBJECT_CLASS (phosh_gnome_shell_manager_parent_class)->dispose (object);
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment