init glib langs on startup

works around a crash under heavy load, see

https://github.com/openslide/openslide/issues/161
This commit is contained in:
John Cupitt 2015-04-26 10:30:39 +01:00
parent 6c6d0d6b78
commit ffdd9ff851
2 changed files with 7 additions and 0 deletions

View File

@ -1,5 +1,6 @@
25/4/15 started 8.0.1
- fix some compiler warnings
- work around a glib bug that can cause segv under load
11/2/15 started 8.0
- remove old doc stuff, lots of doc improvements

View File

@ -277,6 +277,12 @@ vips_init( const char *argv0 )
g_thread_init( NULL );
#endif
/* This does an unsynchronised static hash table init on first call --
* we have to make sure we do this single-threaded. See:
* https://github.com/openslide/openslide/issues/161
*/
(void) g_get_language_names();
if( !vips__global_lock )
vips__global_lock = vips_g_mutex_new();