move the pdfium lock init

move it inside the existing ONCE

see https://github.com/libvips/libvips/pull/1857
This commit is contained in:
John Cupitt 2020-10-13 15:00:13 +01:00
parent 62ad3c222e
commit 5556f1ec65
2 changed files with 5 additions and 10 deletions

View File

@ -5,6 +5,7 @@
- add VipsInterpolate and guint64 support to C++ API
- add VImage::new_from_memory_steal [Zeranoe]
- vipsthumbnail supports stdin / stdout thumbnailing
- have a lock just for pdfium [DarthSim]
6/9/20 started 8.10.2
- update magicksave/load profile handling [kelilevi]

View File

@ -8,6 +8,8 @@
* - shut down the input file as soon as we can [kleisauke]
* 8/8/19
* - add locks, since pdfium is not threadsafe in any way
* 13/10/20
* - have a lock just for pdfium [DarthSim]
*/
/*
@ -169,6 +171,8 @@ vips_pdfium_init_cb( void *dummy )
{
FPDF_LIBRARY_CONFIG config;
vips_pdfium_mutex = vips_g_mutex_new();
config.version = 2;
config.m_pUserFontPaths = NULL;
config.m_pIsolate = NULL;
@ -524,19 +528,9 @@ vips_foreign_load_pdf_load( VipsForeignLoad *load )
return( 0 );
}
static void *
vips_pdfium_init_mutex( void *data )
{
vips_pdfium_mutex = vips_g_mutex_new();
return( NULL );
}
static void
vips_foreign_load_pdf_class_init( VipsForeignLoadPdfClass *class )
{
static GOnce vips_pdfium_once = G_ONCE_INIT;
VIPS_ONCE( &vips_pdfium_once, vips_pdfium_init_mutex, NULL );
GObjectClass *gobject_class = G_OBJECT_CLASS( class );
VipsObjectClass *object_class = (VipsObjectClass *) class;
VipsForeignLoadClass *load_class = (VipsForeignLoadClass *) class;