Commit 67590c04 authored by Michael Natterer's avatar Michael Natterer 😴

app: unref tool options and presets in dispose() instead of finalize()

parent bfbdf1cf
......@@ -45,6 +45,7 @@ enum
};
static void gimp_tool_info_dispose (GObject *object);
static void gimp_tool_info_finalize (GObject *object);
static void gimp_tool_info_get_property (GObject *object,
guint property_id,
......@@ -69,6 +70,7 @@ gimp_tool_info_class_init (GimpToolInfoClass *klass)
GObjectClass *object_class = G_OBJECT_CLASS (klass);
GimpViewableClass *viewable_class = GIMP_VIEWABLE_CLASS (klass);
object_class->dispose = gimp_tool_info_dispose;
object_class->finalize = gimp_tool_info_finalize;
object_class->get_property = gimp_tool_info_get_property;
object_class->set_property = gimp_tool_info_set_property;
......@@ -103,6 +105,27 @@ gimp_tool_info_init (GimpToolInfo *tool_info)
tool_info->paint_info = NULL;
}
static void
gimp_tool_info_dispose (GObject *object)
{
GimpToolInfo *tool_info = GIMP_TOOL_INFO (object);
if (tool_info->tool_options)
{
g_object_run_dispose (G_OBJECT (tool_info->tool_options));
g_object_unref (tool_info->tool_options);
tool_info->tool_options = NULL;
}
if (tool_info->presets)
{
g_object_unref (tool_info->presets);
tool_info->presets = NULL;
}
G_OBJECT_CLASS (parent_class)->dispose (object);
}
static void
gimp_tool_info_finalize (GObject *object)
{
......@@ -141,18 +164,6 @@ gimp_tool_info_finalize (GObject *object)
tool_info->help_id = NULL;
}
if (tool_info->tool_options)
{
g_object_unref (tool_info->tool_options);
tool_info->tool_options = NULL;
}
if (tool_info->presets)
{
g_object_unref (tool_info->presets);
tool_info->presets = NULL;
}
G_OBJECT_CLASS (parent_class)->finalize (object);
}
......
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