vips_class_map_all() was broken

This commit is contained in:
John Cupitt 2011-10-11 21:09:39 +01:00
parent ffe4483030
commit 122c390c7b
2 changed files with 15 additions and 6 deletions

View File

@ -2,6 +2,7 @@
- fallback vips_init() - fallback vips_init()
- im_openout() compat stub was wrong, breaking ruby-vips - im_openout() compat stub was wrong, breaking ruby-vips
- vips_class_map_concrete_all() needed a compat macro too - vips_class_map_concrete_all() needed a compat macro too
- vips_class_map_all() was broken
10/8/11 started 7.26.3 10/8/11 started 7.26.3
- don't use G_VALUE_COLLECT_INIT(), many platforms do not have a glib this - don't use G_VALUE_COLLECT_INIT(), many platforms do not have a glib this

View File

@ -1598,16 +1598,24 @@ vips_class_map_all( GType type, VipsClassMap fn, void *a )
{ {
void *result; void *result;
/* We can't instantiate abstract classes.
*/
if( !G_TYPE_IS_ABSTRACT( type ) ) {
/* We never unref this ref, but we never unload classes /* We never unref this ref, but we never unload classes
* anyway, so so what. * anyway, so so what.
*/ */
if( !(result = fn( VIPS_OBJECT_CLASS( g_type_class_ref( type ) ), a )) ) if( (result = fn(
result = vips_type_map( type, VIPS_OBJECT_CLASS( g_type_class_ref( type ) ), a )) )
(VipsTypeMap2) vips_class_map_all, fn, a );
return( result ); return( result );
} }
if( (result = vips_type_map( type,
(VipsTypeMap2) vips_class_map_all, fn, a )) )
return( result );
return( NULL );
}
/* How deeply nested is a class ... used to indent class lists. /* How deeply nested is a class ... used to indent class lists.
*/ */
int int