better leak checl output

This commit is contained in:
John Cupitt 2011-11-06 10:20:47 +00:00
parent ac2fb4a823
commit ebc0e54217
3 changed files with 31 additions and 11 deletions

13
TODO
View File

@ -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

View File

@ -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 ) );
}
}

View File

@ -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;