Commit 8d544764 authored by Michael Natterer's avatar Michael Natterer 😴

Bug 795493 - Warning when removing a text layer

In gimp_text_tool_connect(), when auto-removing empty text layers upon
text layer or tool change, make sure we don't try to remove a layer
that has already been removed, which can happen if this function is
reached *because* somehow the layer was removed externally (e.g. by
the user in the layers dialog).
parent 9bbd763d
......@@ -1186,18 +1186,28 @@ gimp_text_tool_connect (GimpTextTool *text_tool,
if (text_tool->layer != layer)
{
if (text_tool->layer)
g_signal_handlers_disconnect_by_func (text_tool->layer,
gimp_text_tool_layer_notify,
text_tool);
{
g_signal_handlers_disconnect_by_func (text_tool->layer,
gimp_text_tool_layer_notify,
text_tool);
gimp_text_tool_remove_empty_text_layer (text_tool);
/* don't try to remove the layer if it is not attached,
* which can happen if we got here because the layer was
* somehow deleted from the image (like by the user in the
* layers dialog).
*/
if (gimp_item_is_attached (GIMP_ITEM (text_tool->layer)))
gimp_text_tool_remove_empty_text_layer (text_tool);
}
text_tool->layer = layer;
if (layer)
g_signal_connect_object (text_tool->layer, "notify",
G_CALLBACK (gimp_text_tool_layer_notify),
text_tool, 0);
{
g_signal_connect_object (text_tool->layer, "notify",
G_CALLBACK (gimp_text_tool_layer_notify),
text_tool, 0);
}
}
}
......
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