better leak reporting

Vips::print_all now shows VipsArea leaks as well
This commit is contained in:
John Cupitt 2015-05-01 16:42:23 +01:00
parent 728f5a0401
commit bfeeb3eb27
4 changed files with 7 additions and 5 deletions

View File

@ -2,6 +2,7 @@
- fix some compiler warnings
- work around a glib bug that can cause segv under load
- add some notes on threading to the docs
- better leak reporting
11/2/15 started 8.0
- remove old doc stuff, lots of doc improvements

View File

@ -451,8 +451,6 @@ vips_leak( void )
fprintf( stderr, "%s", vips_buf_all( &buf ) );
vips__type_leak();
#ifdef DEBUG
vips_buffer_dump_all();
#endif /*DEBUG*/

View File

@ -2949,6 +2949,8 @@ vips_object_print_all( void )
vips_object_map(
(VipsSListMap2Fn) vips_object_print_all_cb, &n, NULL );
}
vips__type_leak();
}
static void *

View File

@ -273,13 +273,14 @@ vips__type_leak( void )
if( vips_area_all ) {
GSList *p;
printf( "VipsArea leaks:\n" );
fprintf( stderr, "%d VipsArea alive\n",
g_slist_length( vips_area_all ) );
for( p = vips_area_all; p; p = p->next ) {
VipsArea *area = (VipsArea *) p->data;
printf( "\t%p count = %d\n", area, area->count );
fprintf( stderr, "\t%p count = %d, bytes = %zd\n",
area, area->count, area->length );
}
printf( "%d in total\n", g_slist_length( vips_area_all ) );
}
}