small fixes to make helgrind pass

nothing significant, but watermark.c now passes helgrind cleanly
This commit is contained in:
John Cupitt 2017-03-27 09:59:04 +01:00
parent cf938280d0
commit 73c370e7e9
2 changed files with 17 additions and 12 deletions

View File

@ -262,13 +262,19 @@ vips_tracked_free( void *s )
VIPS_GATE_FREE( size ); VIPS_GATE_FREE( size );
} }
static void
vips_tracked_init_mutex( void )
{
vips_tracked_mutex = vips_g_mutex_new();
}
static void static void
vips_tracked_init( void ) vips_tracked_init( void )
{ {
static GOnce vips_tracked_once = G_ONCE_INIT; static GOnce vips_tracked_once = G_ONCE_INIT;
vips_tracked_mutex = g_once( &vips_tracked_once, g_once( &vips_tracked_once,
(GThreadFunc) vips_g_mutex_new, NULL ); (GThreadFunc) vips_tracked_init_mutex, NULL );
} }
/** /**

View File

@ -2772,20 +2772,20 @@ vips_class_add_hash( VipsObjectClass *class, GHashTable *table )
return( NULL ); return( NULL );
} }
static void * static void
vips_class_build_hash( void ) vips_class_build_hash( void )
{ {
GHashTable *table;
GType base; GType base;
table = g_hash_table_new( g_str_hash, g_str_equal ); vips__object_nickname_table =
g_hash_table_new( g_str_hash, g_str_equal );
base = g_type_from_name( "VipsObject" );
g_assert( base );
if( !(base = g_type_from_name( "VipsObject" )) )
return( NULL );
vips_class_map_all( base, vips_class_map_all( base,
(VipsClassMapFn) vips_class_add_hash, (void *) table ); (VipsClassMapFn) vips_class_add_hash,
(void *) vips__object_nickname_table );
return( table );
} }
/** /**
@ -2814,8 +2814,7 @@ vips_type_find( const char *basename, const char *nickname )
GType base; GType base;
GType type; GType type;
vips__object_nickname_table = (GHashTable *) g_once( &once, g_once( &once, (GThreadFunc) vips_class_build_hash, NULL );
(GThreadFunc) vips_class_build_hash, NULL );
hit = (NicknameGType *) hit = (NicknameGType *)
g_hash_table_lookup( vips__object_nickname_table, g_hash_table_lookup( vips__object_nickname_table,