Intern the name here, since we need the quark anyway when sending change
authorMatthias Clasen <mclasen@redhat.com>
Wed, 31 Aug 2005 19:13:26 +0000 (19:13 +0000)
committerMatthias Clasen <matthiasc@src.gnome.org>
Wed, 31 Aug 2005 19:13:26 +0000 (19:13 +0000)
2005-08-31  Matthias Clasen  <mclasen@redhat.com>

* gparam.c (g_param_spec_internal): Intern the name here,
since we need the quark anyway when sending change notification.

gobject/gparam.c

index 3174715..6bbeb71 100644 (file)
@@ -291,6 +291,7 @@ g_param_spec_internal (GType        param_type,
                       GParamFlags  flags)
 {
   GParamSpec *pspec;
+  gchar *tmp;
   
   g_return_val_if_fail (G_TYPE_IS_PARAM (param_type) && param_type != G_TYPE_PARAM, NULL);
   g_return_val_if_fail (name != NULL, NULL);
@@ -300,11 +301,12 @@ g_param_spec_internal (GType        param_type,
   pspec = (gpointer) g_type_create_instance (param_type);
 
   if ((flags & G_PARAM_STATIC_NAME))
-    pspec->name = (gchar *) name;
+    pspec->name = g_intern_static_string (name);
   else
     {
-      pspec->name = g_strdup (name);
-      canonicalize_key (pspec->name);
+      tmp = g_strdup (name);
+      canonicalize_key (tmp);
+      pspec->name = g_intern_string (tmp);
     }
 
   if (flags & G_PARAM_STATIC_NICK)