[libdazzle/libdazzle-3-26] shortcuts: contexts hashtable expects interned string
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [libdazzle/libdazzle-3-26] shortcuts: contexts hashtable expects interned string
- Date: Thu, 11 Jan 2018 01:03:28 +0000 (UTC)
commit 501f43e65f4e7cd88665555802cb209d764ee5d5
Author: Christian Hergert <chergert redhat com>
Date: Wed Dec 13 21:54:58 2017 -0800
shortcuts: contexts hashtable expects interned string
This was both a leak and incorrect because we use the pointer as
the hash key in the hashtable.
src/shortcuts/dzl-shortcut-theme.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
---
diff --git a/src/shortcuts/dzl-shortcut-theme.c b/src/shortcuts/dzl-shortcut-theme.c
index f32ac0b..3f40057 100644
--- a/src/shortcuts/dzl-shortcut-theme.c
+++ b/src/shortcuts/dzl-shortcut-theme.c
@@ -352,7 +352,7 @@ dzl_shortcut_theme_add_context (DzlShortcutTheme *self,
g_return_if_fail (name != NULL);
- g_hash_table_insert (priv->contexts, g_strdup (name), g_object_ref (context));
+ g_hash_table_insert (priv->contexts, (gchar *)g_intern_string (name), g_object_ref (context));
}
DzlShortcutTheme *
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]