diff --git a/ChangeLog b/ChangeLog index 088bbfe1..b749c1b4 100644 --- a/ChangeLog +++ b/ChangeLog @@ -8,6 +8,7 @@ memory and file descriptors - add vips_image_get_format_max() - flatten handles out of range alpha and max_alpha correctly +- don't use atexit for cleanup, it's too unreliable 16/8/21 started 8.11.4 - fix off-by-one error in new rank fast path diff --git a/doc/using-C.xml b/doc/using-C.xml index 2ad7083d..b092d31f 100644 --- a/doc/using-C.xml +++ b/doc/using-C.xml @@ -29,8 +29,13 @@ When your program starts, use VIPS_INIT() to start up the VIPS library. You should pass it the name - of your program, usually argv[0]. Use - vips_shutdown() when you exit. VIPS_INIT() is a macro to let it check + of your program, usually argv[0]. If you call + vips_shutdown() just before you exit, libvips will attempt to free all + resources. This can help leak checking, but is not required. + + + + VIPS_INIT() is a macro to let it check that the libvips library you have linked to matches the libvips headers you included. diff --git a/libvips/iofuncs/init.c b/libvips/iofuncs/init.c index 348c9dc7..c7af1011 100644 --- a/libvips/iofuncs/init.c +++ b/libvips/iofuncs/init.c @@ -30,6 +30,10 @@ * - hide warnings is VIPS_WARNING is set * 20/4/19 * - set the min stack, if we can + * 17/9/21 + * - don't use atexit for cleanup, it's too unreliable ... users should + * call vips_shutdown explicitly if they want a clean exit, though a + * dirty exit is fine */ /* @@ -726,6 +730,9 @@ vips_thread_shutdown( void ) * Call this to drop caches and close plugins. Run with "--vips-leak" to do * a leak check too. * + * vips_shutdown() is optional. If you don't call it, your platform will + * clean up for you. + * * You may call VIPS_INIT() many times and vips_shutdown() many times, but you * must not call VIPS_INIT() after vips_shutdown(). In other words, you cannot * stop and restart vips. @@ -754,11 +761,8 @@ vips_shutdown( void ) } vips__render_shutdown(); - vips_thread_shutdown(); - vips__thread_profile_stop(); - vips__threadpool_shutdown(); #ifdef HAVE_GSF