fix two tiny memleaks

This commit is contained in:
John Cupitt 2014-01-14 12:07:50 +00:00
parent 0aa521a09e
commit 1090f48900
2 changed files with 22 additions and 19 deletions

View File

@ -144,25 +144,6 @@ vips_thread_profile_save( VipsThreadProfile *profile )
g_mutex_unlock( vips__global_lock );
}
static void
vips_thread_profile_free( VipsThreadProfile *profile )
{
VIPS_DEBUG_MSG( "vips_thread_profile_free: %s\n", profile->name );
if( vips__thread_profile )
vips_thread_profile_save( profile );
VIPS_FREEF( g_hash_table_destroy, profile->gates );
VIPS_FREE( profile );
}
void
vips__thread_profile_stop( void )
{
if( vips__thread_profile )
VIPS_FREEF( fclose, vips__thread_fp );
}
static void
vips_thread_gate_block_free( VipsThreadGateBlock *block )
{
@ -178,6 +159,26 @@ vips_thread_gate_free( VipsThreadGate *gate )
VIPS_FREE( gate );
}
static void
vips_thread_profile_free( VipsThreadProfile *profile )
{
VIPS_DEBUG_MSG( "vips_thread_profile_free: %s\n", profile->name );
if( vips__thread_profile )
vips_thread_profile_save( profile );
VIPS_FREEF( g_hash_table_destroy, profile->gates );
VIPS_FREEF( vips_thread_gate_free, profile->memory );
VIPS_FREE( profile );
}
void
vips__thread_profile_stop( void )
{
if( vips__thread_profile )
VIPS_FREEF( fclose, vips__thread_fp );
}
static void
vips__thread_profile_init_cb( VipsThreadProfile *profile )
{

View File

@ -177,6 +177,8 @@ vips_thread_run( gpointer data )
vips__buffer_shutdown();
vips__thread_profile_detach();
g_free( info );
return( result );
}