allow NULLs for output params

so you can now do im_minpos (im, &min, NULL, NULL);
This commit is contained in:
John Cupitt 2011-09-23 17:03:02 +01:00
parent 9c6f08f22f
commit fbc3b1f608
2 changed files with 15 additions and 25 deletions

15
TODO
View File

@ -1,18 +1,3 @@
- strange
$ vips avg babe.jpg
222.370525
$ vips im_avg babe.jpg
222.371
** leak test on exit:
3 objects alive:
0) VipsAvg (0x1840df0)
1) VipsImage (0x1844740)
2) VipsImage (0x17b2d90)
- get rid of useless DMALLOC stuff

View File

@ -446,18 +446,23 @@ vips_operation_get_valist_optional( VipsOperation *operation, va_list ap )
g_param_spec_get_name( pspec ), arg );
#endif /*VIPS_DEBUG */
g_object_get( G_OBJECT( operation ),
g_param_spec_get_name( pspec ), arg, NULL );
/* If the pspec is an object, that will up the ref
* count. We want to hand over the ref, so we have to
* knock it down again.
/* If the dest pointer is NULL, skip the read.
*/
if( G_IS_PARAM_SPEC_OBJECT( pspec ) ) {
GObject *object;
if( arg ) {
g_object_get( G_OBJECT( operation ),
g_param_spec_get_name( pspec ), arg,
NULL );
object = *((GObject **) arg);
g_object_unref( object );
/* If the pspec is an object, that will up
* the ref count. We want to hand over the
* ref, so we have to knock it down again.
*/
if( G_IS_PARAM_SPEC_OBJECT( pspec ) ) {
GObject *object;
object = *((GObject **) arg);
g_object_unref( object );
}
}
VIPS_OPERATION_COLLECT_END