Ejemplo n.º 1
0
/**
 * vips_shutdown:
 *
 * Call this to drop caches and close plugins. Run with "--vips-leak" to do 
 * a leak check too. 
 *
 * 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. 
 */
void
vips_shutdown( void )
{
#ifdef DEBUG
	printf( "vips_shutdown:\n" );
#endif /*DEBUG*/

	vips_cache_drop_all();

	im_close_plugins();

	/* Mustn't run this more than once. Don't use the VIPS_GATE macro,
	 * since we don't for gate start.
	 */
{
	static gboolean done = FALSE;

	if( !done ) 
		vips__thread_gate_stop( "init: main" ); 
}

	vips__render_shutdown();

	vips_thread_shutdown();

	vips__thread_profile_stop();

#ifdef HAVE_GSF
	gsf_shutdown(); 
#endif /*HAVE_GSF*/

	/* In dev releases, always show leaks. But not more than once, it's
	 * annoying.
	 */
#ifndef DEBUG_LEAK
	if( vips__leak ) 
#endif /*DEBUG_LEAK*/
	{
		static gboolean done = FALSE;

		if( !done ) 
			vips_leak();

		done = TRUE;
	}
}
Ejemplo n.º 2
0
static void *
vips_thread_run( gpointer data )
{
	VipsThreadInfo *info = (VipsThreadInfo *) data;

	void *result;

	if( vips__thread_profile ) 
		vips__thread_profile_attach( info->domain );

	result = info->func( info->data );

	g_free( info ); 

	vips_thread_shutdown();

	return( result ); 
}
Ejemplo n.º 3
0
/*
 *  call-seq:
 *     VIPS.thread_shutdown -> string
 *
 *   Free any thread-private data and flush any profiling information.
 *   
 *   This function needs to be called when a thread that has been using vips
 *   exits. It is called for you by vips_shutdown() and for any threads created
 *   by vips_g_thread_new(). 
 *    
 *   You will need to call it from threads created in other ways. If you do 
 *   not call it, vips will generate an error message.
 *    
 *   May be called many times. 
 */
static VALUE
vips_s_thread_shutdown(VALUE obj)
{
    vips_thread_shutdown();
    return Qnil;
}