From 024244bfbc99eb1de0273ab729be23bd2044e7f7 Mon Sep 17 00:00:00 2001 From: John Cupitt Date: Sat, 18 Sep 2021 14:04:05 +0100 Subject: [PATCH] don't free global_lcol on shutdown since we need to be able to call things like error_buf after shutdown in leak testing --- libvips/iofuncs/init.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/libvips/iofuncs/init.c b/libvips/iofuncs/init.c index c7af1011..6c03cfef 100644 --- a/libvips/iofuncs/init.c +++ b/libvips/iofuncs/init.c @@ -769,9 +769,12 @@ vips_shutdown( void ) gsf_shutdown(); #endif /*HAVE_GSF*/ + /* Don't free vips__global_lock -- we want to be able to use + * vips_error_buffer() after vips_shutdown(), since vips_leak() can + * call it. + */ VIPS_FREE( vips__argv0 ); VIPS_FREE( vips__prgname ); - VIPS_FREEF( vips_g_mutex_free, vips__global_lock ); VIPS_FREEF( g_timer_destroy, vips__global_timer ); }