glib-genmarshal generated valist marshal does not respect static scope for some types
A glib-genmarhal generated valist marshaler for the STRING type does not respect the static scope, instead always duping the string.
Comparing the code generated by
glib-genmarshal --nostdinc for a VOID:STRING valist marshaler, with the code that's in glib/gobject/gmarshal.c shows this diff:
--- gmarshal.c +++ testmarshal.c [...] - if ((param_types & G_SIGNAL_TYPE_STATIC_SCOPE) == 0 && arg0 != NULL) + if (arg0 != NULL) arg0 = g_strdup (arg0); [...] - if ((param_types & G_SIGNAL_TYPE_STATIC_SCOPE) == 0 && arg0 != NULL) + if (arg0 != NULL) g_free (arg0);
(Also, the g_free() doesn't need to be guarded by if (arg0 != NULL) since g_free() is NULL-safe.)
The same problem also happens for the PARAM type.
glib master as of 57a1d793.