mirror of
				https://gitlab.gnome.org/GNOME/glib.git
				synced 2025-11-04 01:58:54 +01:00 
			
		
		
		
	fix pspec->name assignment which needs to be strdup()ed for non
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.
This commit is contained in:
		@@ -1,3 +1,13 @@
 | 
			
		||||
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
 | 
			
		||||
 
 | 
			
		||||
@@ -291,7 +291,6 @@ 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,23 +299,26 @@ g_param_spec_internal (GType        param_type,
 | 
			
		||||
  
 | 
			
		||||
  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);
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -87,7 +87,7 @@ struct _GSignalQuery
 | 
			
		||||
  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 */
 | 
			
		||||
};
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user