fix a progress crash
progress was not always being signalled on the right image in sink.c
This commit is contained in:
parent
db41b6ac4e
commit
c8fc3e6c85
@ -1306,6 +1306,8 @@ vips_progress_add( VipsImage *image )
|
||||
{
|
||||
VipsProgress *progress;
|
||||
|
||||
VIPS_DEBUG_MSG( "vips_progress_add: %p\n", image );
|
||||
|
||||
if( !(progress = image->time) ) {
|
||||
if( !(image->time = VIPS_NEW( NULL, VipsProgress )) )
|
||||
return( -1 );
|
||||
@ -1333,6 +1335,8 @@ vips_progress_update( VipsProgress *progress, int w, int h )
|
||||
{
|
||||
float prop;
|
||||
|
||||
VIPS_DEBUG_MSG( "vips_progress_update: %p\n", progress );
|
||||
|
||||
g_assert( progress );
|
||||
|
||||
progress->run = g_timer_elapsed( progress->start, NULL );
|
||||
|
@ -357,7 +357,10 @@ vips_sink_tile( VipsImage *im,
|
||||
sink.sink_base.tile_height = tile_height;
|
||||
}
|
||||
|
||||
vips_image_preeval( sink.t );
|
||||
/* vips_sink_base_progress() signals progress on im, so we have to do
|
||||
* pre/post on that too.
|
||||
*/
|
||||
vips_image_preeval( im );
|
||||
|
||||
result = vips_threadpool_run( im,
|
||||
sink_thread_state_new,
|
||||
@ -366,7 +369,7 @@ vips_sink_tile( VipsImage *im,
|
||||
vips_sink_base_progress,
|
||||
&sink );
|
||||
|
||||
vips_image_posteval( sink.t );
|
||||
vips_image_posteval( im );
|
||||
|
||||
sink_free( &sink );
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user