oops, keep Render alive for longer
This commit is contained in:
parent
c80452f70b
commit
96964001c7
@ -41,6 +41,8 @@
|
|||||||
* - im_render(), im_render_fade() moved to deprecated
|
* - im_render(), im_render_fade() moved to deprecated
|
||||||
* 22/1/10
|
* 22/1/10
|
||||||
* - drop painted tiles on invalidate
|
* - drop painted tiles on invalidate
|
||||||
|
* 10/3/10
|
||||||
|
* - keep render alive until both in and out close
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -641,7 +643,10 @@ render_new( IMAGE *in, IMAGE *out, IMAGE *mask,
|
|||||||
if( !(render = IM_NEW( NULL, Render )) )
|
if( !(render = IM_NEW( NULL, Render )) )
|
||||||
return( NULL );
|
return( NULL );
|
||||||
|
|
||||||
render->ref_count = 1;
|
/* Both in and out need to close before we can go, so ref_count starts
|
||||||
|
* at 2.
|
||||||
|
*/
|
||||||
|
render->ref_count = 2;
|
||||||
render->ref_count_lock = g_mutex_new();
|
render->ref_count_lock = g_mutex_new();
|
||||||
|
|
||||||
render->in = in;
|
render->in = in;
|
||||||
@ -671,6 +676,11 @@ render_new( IMAGE *in, IMAGE *out, IMAGE *mask,
|
|||||||
(void) render_unref( render );
|
(void) render_unref( render );
|
||||||
return( NULL );
|
return( NULL );
|
||||||
}
|
}
|
||||||
|
if( im_add_close_callback( in,
|
||||||
|
(im_callback_fn) render_unref, render, NULL ) ) {
|
||||||
|
(void) render_unref( render );
|
||||||
|
return( NULL );
|
||||||
|
}
|
||||||
|
|
||||||
if( im_add_invalidate_callback( in,
|
if( im_add_invalidate_callback( in,
|
||||||
(im_callback_fn) render_invalidate, render, NULL ) )
|
(im_callback_fn) render_invalidate, render, NULL ) )
|
||||||
|
Loading…
Reference in New Issue
Block a user