From 64d081e726efa2a4e912aa48cd3f8c486b6b259c Mon Sep 17 00:00:00 2001 From: John Cupitt Date: Fri, 16 Oct 2015 14:50:44 +0100 Subject: [PATCH] return default value for unset props we used to issue a warning and return early, but this can leave garbage in the *value pointer, I think ruby gobject-introspection will walk object props during GC and can see state inbetween init and build when not all objects have been given a value ... we don't want these warnings --- ChangeLog | 1 + doc/libvips-docs.xml | 4 ---- libvips/iofuncs/object.c | 11 ++++++----- 3 files changed, 7 insertions(+), 9 deletions(-) diff --git a/ChangeLog b/ChangeLog index d93c3158..36b7ef1d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,6 @@ 7/10/15 started 8.2.0 - added im_bufmagick2vips(), a vips7 wrapper for magick load from buffer +- fetch unset property now returns default value rather than warning 7/5/15 started 8.1.1 - oop, vips-8.0 should be vips-8.1, thanks Danilo diff --git a/doc/libvips-docs.xml b/doc/libvips-docs.xml index e799e5b7..7020e734 100644 --- a/doc/libvips-docs.xml +++ b/doc/libvips-docs.xml @@ -9,11 +9,7 @@ VIPS Reference Manual -<<<<<<< HEAD For VIPS 8.2.0. -======= - For VIPS 8.1.1. ->>>>>>> 8.1 The latest version of this documentation can be found on the VIPS website. diff --git a/libvips/iofuncs/object.c b/libvips/iofuncs/object.c index 3e7af9ce..aa420e82 100644 --- a/libvips/iofuncs/object.c +++ b/libvips/iofuncs/object.c @@ -1315,11 +1315,12 @@ vips_object_get_property( GObject *gobject, g_assert( ((VipsArgument *) argument_class)->pspec == pspec ); if( !argument_instance->assigned ) { - g_warning( "%s: %s.%s attempt to read unset %s property", - G_STRLOC, - G_OBJECT_TYPE_NAME( gobject ), - g_param_spec_get_name( pspec ), - g_type_name( G_PARAM_SPEC_VALUE_TYPE( pspec ) ) ); + /* Set the value to the default. Things like Ruby + * gobject-introspection will walk objects during GC, and we + * can find ourselves fetching object vaklues between init and + * build. + */ + g_param_value_set_default( pspec, value ); return; }