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

app: unref the paint options in dispose() instead of finalize()

parent 5db9d314
......@@ -27,6 +27,7 @@
#include "gimppaintinfo.h"
static void gimp_paint_info_dispose (GObject *object);
static void gimp_paint_info_finalize (GObject *object);
static gchar * gimp_paint_info_get_description (GimpViewable *viewable,
gchar **tooltip);
......@@ -43,6 +44,7 @@ gimp_paint_info_class_init (GimpPaintInfoClass *klass)
GObjectClass *object_class = G_OBJECT_CLASS (klass);
GimpViewableClass *viewable_class = GIMP_VIEWABLE_CLASS (klass);
object_class->dispose = gimp_paint_info_dispose;
object_class->finalize = gimp_paint_info_finalize;
viewable_class->get_description = gimp_paint_info_get_description;
......@@ -57,6 +59,20 @@ gimp_paint_info_init (GimpPaintInfo *paint_info)
paint_info->paint_options = NULL;
}
static void
gimp_paint_info_dispose (GObject *object)
{
GimpPaintInfo *paint_info = GIMP_PAINT_INFO (object);
if (paint_info->paint_options)
{
g_object_unref (paint_info->paint_options);
paint_info->paint_options = NULL;
}
G_OBJECT_CLASS (parent_class)->dispose (object);
}
static void
gimp_paint_info_finalize (GObject *object)
{
......@@ -68,12 +84,6 @@ gimp_paint_info_finalize (GObject *object)
paint_info->blurb = NULL;
}
if (paint_info->paint_options)
{
g_object_unref (paint_info->paint_options);
paint_info->paint_options = 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