diff --git a/TODO b/TODO index e2e21343..1dc261ce 100644 --- a/TODO +++ b/TODO @@ -4,6 +4,19 @@ GLib-GObject-WARNING **: invalid cast from `VipsFormatVips' to `VipsOperation' + if( !(type = vips_type_find( "VipsOperation", "vips" )) ) + return( NULL ); + + is finding VipsFormatVips + + though VipsFormatVips is not a subclass of VipsOperation ?!?!? + + vips_type_find() was always searching the whole of VipsObject and ignoring + basename + + changed it back, but what will this break? there was a reason we got rid of + subclass searching I forget what + diff --git a/libvips/iofuncs/init.c b/libvips/iofuncs/init.c index 4b99cd41..915810e8 100644 --- a/libvips/iofuncs/init.c +++ b/libvips/iofuncs/init.c @@ -303,16 +303,15 @@ vips_shutdown( void ) vips_object_print_all(); - vips_buf_appendf( &buf, - "tracked memory: %d allocations totalling %zd bytes\n", + vips_buf_appendf( &buf, "memory: %d allocations, %zd bytes\n", vips_tracked_get_allocs(), vips_tracked_get_mem() ); - vips_buf_appendf( &buf, "tracked memory: high-water mark " ); + vips_buf_appendf( &buf, "memory: high-water mark " ); vips_buf_append_size( &buf, vips_tracked_get_mem_highwater() ); - vips_buf_appendf( &buf, "\ntracked files: %d open\n", + vips_buf_appendf( &buf, "\nfiles: %d open\n", vips_tracked_get_files() ); - printf( "%s", vips_buf_all( &buf ) ); + fprintf( stderr, "%s", vips_buf_all( &buf ) ); } } diff --git a/libvips/iofuncs/object.c b/libvips/iofuncs/object.c index 6bf26935..ce83662e 100644 --- a/libvips/iofuncs/object.c +++ b/libvips/iofuncs/object.c @@ -1757,7 +1757,7 @@ vips_type_find( const char *basename, const char *nickname ) { VipsObjectClass *class; - if( !(class = vips_class_find( "VipsObject", nickname )) ) + if( !(class = vips_class_find( basename, nickname )) ) return( 0 ); return( G_OBJECT_CLASS_TYPE( class ) ); @@ -1839,10 +1839,18 @@ vips_object_local_array( VipsObject *parent, int n ) static void * vips_object_print_all_cb( VipsObject *object, int *n ) { - printf( "%d) ", *n ); - vips_object_print_name( object ); - printf( "\n" ); - vips_object_print( object ); + VipsObjectClass *class = VIPS_OBJECT_GET_CLASS( object ); + + char str[32768]; + VipsBuf buf = VIPS_BUF_STATIC( str ); + + fprintf( stderr, "%d) %s (%p)\n", + *n, G_OBJECT_TYPE_NAME( object ), object ); + + class->print_class( class, &buf ); + vips_buf_appendf( &buf, "\n" ); + class->print( object, &buf ); + fprintf( stderr, "%s\n", vips_buf_all( &buf ) ); *n += 1; @@ -1856,7 +1864,7 @@ vips_object_print_all( void ) g_hash_table_size( vips__object_all ) > 0 ) { int n; - printf( "%d objects alive:\n", + fprintf( stderr, "%d objects alive:\n", g_hash_table_size( vips__object_all ) ); n = 0;