[glib] intern a key name instead of using strdup()



commit 8e060adb2cecb7a801d54e3cbdb0c6eb12f56c12
Author: Ryan Lortie <desrt desrt ca>
Date:   Sun May 16 10:19:46 2010 +0200

    intern a key name instead of using strdup()

 gio/gsettings.c |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)
---
diff --git a/gio/gsettings.c b/gio/gsettings.c
index 8f77c8f..5b894e6 100644
--- a/gio/gsettings.c
+++ b/gio/gsettings.c
@@ -1449,7 +1449,6 @@ g_settings_writable_binding_free (gpointer data)
 
   g_signal_handler_disconnect (binding->settings, binding->handler_id);
   g_object_unref (binding->settings);
-  g_free (binding->key);
   g_slice_free (GSettingsWritableBinding, binding);
 }
 
@@ -1531,7 +1530,7 @@ g_settings_bind_writable (GSettings   *settings,
   binding = g_slice_new (GSettingsWritableBinding);
   binding->settings = g_object_ref (settings);
   binding->object = object;
-  binding->key = g_strdup (key);
+  binding->key = g_intern_string (key);
   binding->property = g_intern_string (property);
   binding->inverted = inverted;
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]