[mutter] keybindings: Consistently use slice allocation for MetaKeyBinding
- From: Jasper St. Pierre <jstpierre src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [mutter] keybindings: Consistently use slice allocation for MetaKeyBinding
- Date: Fri, 9 Jan 2015 22:15:38 +0000 (UTC)
commit 5c60ea6635cd7a3a0fb89fea68bd50a0a7e1f632
Author: Jasper St. Pierre <jstpierre mecheye net>
Date: Thu Jan 8 18:42:37 2015 -0800
keybindings: Consistently use slice allocation for MetaKeyBinding
src/core/keybindings.c | 10 ++++------
1 files changed, 4 insertions(+), 6 deletions(-)
---
diff --git a/src/core/keybindings.c b/src/core/keybindings.c
index db3f04f..6683fc7 100644
--- a/src/core/keybindings.c
+++ b/src/core/keybindings.c
@@ -583,8 +583,7 @@ rebuild_binding_table (MetaKeyBindingManager *keys,
{
MetaKeyHandler *handler = HANDLER (pref->name);
- b = g_malloc0 (sizeof (MetaKeyBinding));
-
+ b = g_slice_new0 (MetaKeyBinding);
b->name = pref->name;
b->handler = handler;
b->flags = handler->flags;
@@ -607,8 +606,7 @@ rebuild_binding_table (MetaKeyBindingManager *keys,
{
MetaKeyHandler *handler = HANDLER ("external-grab");
- b = g_malloc0 (sizeof (MetaKeyBinding));
-
+ b = g_slice_new0 (MetaKeyBinding);
b->name = grab->name;
b->handler = handler;
b->flags = handler->flags;
@@ -1420,7 +1418,7 @@ meta_display_grab_accelerator (MetaDisplay *display,
g_hash_table_insert (external_grabs, grab->name, grab);
- binding = g_malloc0 (sizeof (MetaKeyBinding));
+ binding = g_slice_new0 (MetaKeyBinding);
binding->name = grab->name;
binding->handler = HANDLER ("external-grab");
binding->combo = combo;
@@ -4014,7 +4012,7 @@ meta_display_init_keys (MetaDisplay *display)
keys->super_mask = 0;
keys->meta_mask = 0;
- keys->key_bindings = g_hash_table_new_full (NULL, NULL, NULL, g_free);
+ keys->key_bindings = g_hash_table_new_full (NULL, NULL, NULL, (GDestroyNotify) meta_key_binding_free);
keys->key_bindings_index = g_hash_table_new (NULL, NULL);
reload_modmap (keys);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]