From a5aebabd2d43350a2a7028dd379ba690a0447eb4 Mon Sep 17 00:00:00 2001 From: Michael Natterer Date: Wed, 25 Apr 2007 08:48:46 +0000 Subject: [PATCH] also clear the NOCOPY_CONTENTS flag when replacing NULL with the empty 2007-04-25 Michael Natterer * gparamspecs.c (param_string_validate): also clear the NOCOPY_CONTENTS flag when replacing NULL with the empty string. svn path=/trunk/; revision=5458 --- ChangeLog | 4 ---- gobject/ChangeLog | 11 +++++++++++ gobject/gparamspecs.c | 3 ++- 3 files changed, 13 insertions(+), 5 deletions(-) diff --git a/ChangeLog b/ChangeLog index 59b4c16..0ae1ac6 100644 --- a/ChangeLog +++ b/ChangeLog @@ -7,10 +7,6 @@ 2007-04-24 Michael Natterer - * gobject/gparamspecs.c (param_string_validate): don't free or - modify static strings, dup them when needed and clear the - G_VALUE_NOCOPY_CONTENTS flag. Fixes bug #432895. - * tests/gobject/paramspec-test.c: test all GParamSpecString validations with static and allocated strings. diff --git a/gobject/ChangeLog b/gobject/ChangeLog index 14252b4..0f1f9e8 100644 --- a/gobject/ChangeLog +++ b/gobject/ChangeLog @@ -1,3 +1,14 @@ +2007-04-25 Michael Natterer + + * gparamspecs.c (param_string_validate): also clear the + NOCOPY_CONTENTS flag when replacing NULL with the empty string. + +2007-04-24 Michael Natterer + + * gparamspecs.c (param_string_validate): don't free or modify + static strings, dup them when needed and clear the + G_VALUE_NOCOPY_CONTENTS flag. Fixes bug #432895. + Tue Apr 3 12:34:14 2007 Tim Janik * gobject.[hc]: invoke GObjectClass.constructed() only for newly diff --git a/gobject/gparamspecs.c b/gobject/gparamspecs.c index ea502b3..5ba8977 100644 --- a/gobject/gparamspecs.c +++ b/gobject/gparamspecs.c @@ -665,11 +665,12 @@ param_string_validate (GParamSpec *pspec, } if (sspec->ensure_non_null && !string) { + value->data[1].v_uint &= ~G_VALUE_NOCOPY_CONTENTS; value->data[0].v_pointer = g_strdup (""); changed++; string = value->data[0].v_pointer; } - + return changed; } -- 2.7.4