Commit 36c885a6 authored by Jehan's avatar Jehan

app: fix a line art leak in bucket fill tool.

Introduced in commit b4e12fbb:
gimp_pickable_contiguous_region_prepare_line_art_async() was running
gimp_pickable_flush(), which provokes the "rendered" signal on the
image projection when a change occured. As a result, it was calling
gimp_bucket_fill_compute_line_art() within itself and since
tool->priv->async was not set yet, none of the call were canceled. Hence
the same line art is computed twice, but one is leaked.
Make sure we block this signal handler as a solution.
parent 963eef82
......@@ -732,12 +732,23 @@ gimp_bucket_fill_compute_line_art (GimpBucketFillTool *tool)
if (pickable)
/* gimp_pickable_contiguous_region_prepare_line_art_async()
* will flush the pickable, which may trigger this signal
* handler, and will leak a line art (as tool->priv->async has
* not been set yet.
g_signal_handlers_block_by_func (gimp_image_get_projection (GIMP_IMAGE (image)),
G_CALLBACK (gimp_bucket_fill_tool_projection_rendered),
tool->priv->async =
gimp_pickable_contiguous_region_prepare_line_art_async (
g_signal_handlers_unblock_by_func (gimp_image_get_projection (GIMP_IMAGE (image)),
G_CALLBACK (gimp_bucket_fill_tool_projection_rendered),
gimp_async_add_callback (tool->priv->async,
(GimpAsyncCallback) gimp_bucket_fill_compute_line_art_cb,
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment