+Thu Sep 22 12:42:12 2005 Tim Janik <timj@gtk.org>
+
+ * gparam.c (g_param_spec_internal): fix pspec->name assignment which
+ needs to be strdup()ed for non G_PARAM_STATIC_NAME pspecs. this fixes
+ recently introduced crashes during plugin unloading.
+ also, ensure that static pspec names are canonicalized.
+
+ * gsignal.h: reverted last change from matthias, we don't guarantee
+ that type ids aren't mangled with G_SIGNAL_TYPE_STATIC_SCOPE anywhere.
+
2005-09-20 Matthias Clasen <mclasen@redhat.com>
* gsignal.h (struct _GSignalQuery): Remove the misleading comment
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);
pspec = (gpointer) g_type_create_instance (param_type);
- if ((flags & G_PARAM_STATIC_NAME))
- pspec->name = g_intern_static_string (name);
+ if (flags & G_PARAM_STATIC_NAME)
+ {
+ pspec->name = g_intern_static_string (name);
+ if (!is_canonical (pspec->name))
+ g_warning ("G_PARAM_STATIC_NAME used with non-canonical pspec name: %s", pspec->name);
+ }
else
{
- tmp = g_strdup (name);
- canonicalize_key (tmp);
- pspec->name = g_intern_string (tmp);
- g_free (tmp);
+ pspec->name = g_strdup (name);
+ canonicalize_key (pspec->name);
+ g_intern_string (pspec->name);
}
if (flags & G_PARAM_STATIC_NICK)
- pspec->_nick = (gchar *) nick;
+ pspec->_nick = (gchar*) nick;
else
pspec->_nick = g_strdup (nick);
if (flags & G_PARAM_STATIC_BLURB)
- pspec->_blurb = (gchar *) blurb;
+ pspec->_blurb = (gchar*) blurb;
else
pspec->_blurb = g_strdup (blurb);
const gchar *signal_name;
GType itype;
GSignalFlags signal_flags;
- GType return_type;
+ GType return_type; /* mangled with G_SIGNAL_TYPE_STATIC_SCOPE flag */
guint n_params;
const GType *param_types; /* mangled with G_SIGNAL_TYPE_STATIC_SCOPE flag */
};