app: do not try to copy a buffer result from a canceled GEGL operation.

This fixes:
> GEGL-WARNING: (../../src/gegl/gegl/buffer/gegl-tile.c:127):gegl_tile_dup: runtime check failed: (! src->damage)

Which happened when a GEGL operation was running and you canceled it in
the middle, say with the ESC key (easy to reproduce with long operations
such as "Color to Gray"). In such case, obviously don't try to copy the
unfinished operation result into the dest buffer.
This commit is contained in:
Jehan 2020-05-18 11:17:41 +02:00
parent 2956873740
commit 2b764c6542
1 changed files with 3 additions and 2 deletions

View File

@ -345,8 +345,9 @@ gimp_gegl_apply_cached_operation (GeglBuffer *src_buffer,
if (result_buffer != dest_buffer)
{
gimp_gegl_buffer_copy (result_buffer, dest_rect, GEGL_ABYSS_NONE,
dest_buffer, dest_rect);
if (! cancel)
gimp_gegl_buffer_copy (result_buffer, dest_rect, GEGL_ABYSS_NONE,
dest_buffer, dest_rect);
g_object_unref (result_buffer);
}