Commit bbd4038e authored by Michael Natterer's avatar Michael Natterer 😴

app: make sure all tool options widgets are properly destroyed

...and with them all references their widgets keep (which are a lot).

Take ownership of the widget after creating it, so it can be reliably
unrefed upon exit.
parent e44d81bd
......@@ -213,6 +213,7 @@ void
gimp_tools_exit (Gimp *gimp)
GList *default_order;
GList *list;
g_return_if_fail (GIMP_IS_GIMP (gimp));
......@@ -224,6 +225,19 @@ gimp_tools_exit (Gimp *gimp)
g_object_set_data (G_OBJECT (gimp), "gimp-tools-default-order", NULL);
for (list = gimp_get_tool_info_iter (gimp);
list = g_list_next (list))
GimpToolInfo *tool_info = list->data;
GtkWidget *options_gui;
options_gui = g_object_get_data (G_OBJECT (tool_info->tool_options),
g_object_unref (options_gui);
tool_manager_exit (gimp);
......@@ -342,7 +356,8 @@ gimp_tools_restore (Gimp *gimp)
g_object_set_data (G_OBJECT (tool_info->tool_options),
"gimp-tool-options-gui", options_gui);
g_object_ref_sink (options_gui));
if (tool_info->presets)
gimp_tool_presets_load (tool_info->presets, NULL);
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