Commit 7fc5698f authored by Ell's avatar Ell

app: fix CRITICALs in GimpMeasureTool

In GimpMeasureTool, don't try to access the "straighten" button
when halting the tool if it's NULL, which can happen when the
measure tool is selected upon startup, but is changed before its
tool-options GUI is constructed.
parent 59ef222c
......@@ -494,7 +494,15 @@ gimp_measure_tool_halt (GimpMeasureTool *measure)
GimpMeasureOptions *options = GIMP_MEASURE_TOOL_GET_OPTIONS (measure);
GimpTool *tool = GIMP_TOOL (measure);
gtk_widget_set_sensitive (options->straighten_button, FALSE);
if (options->straighten_button)
{
gtk_widget_set_sensitive (options->straighten_button, FALSE);
g_signal_handlers_disconnect_by_func (
options->straighten_button,
G_CALLBACK (gimp_measure_tool_straighten_button_clicked),
measure);
}
if (tool->display)
gimp_tool_pop_status (tool, tool->display);
......@@ -502,11 +510,6 @@ gimp_measure_tool_halt (GimpMeasureTool *measure)
if (gimp_draw_tool_is_active (GIMP_DRAW_TOOL (measure)))
gimp_draw_tool_stop (GIMP_DRAW_TOOL (measure));
g_signal_handlers_disconnect_by_func (
options->straighten_button,
G_CALLBACK (gimp_measure_tool_straighten_button_clicked),
measure);
gimp_draw_tool_set_widget (GIMP_DRAW_TOOL (tool), NULL);
g_clear_object (&measure->widget);
......
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