Commit 2667c2a3 authored by Massimo Valentini's avatar Massimo Valentini

app: remove a weak ptr when the object lives longer than the ptr

Closing the display filter editor with a filter selected
in the listview on the right, used to produce (quitting GIMP):

==32359== Invalid write of size 8
==32359==    at 0x8808DF5: g_nullify_pointer (glib/glib/gutils.c:2099)
==32359==    by 0x8358781: weak_refs_notify (glib/gobject/gobject.c:2469)
==32359==    by 0x4C3730A: gimp_color_display_dispose (gimp-2-8/libgimpwidgets/gimpcolordisplay.c:197)
==32359==    by 0x83596A7: g_object_unref (glib/gobject/gobject.c:2986)
==32359==    by 0x4C37EFA: gimp_color_display_stack_dispose (gimp-2-8/libgimpwidgets/gimpcolordisplaystack.c:150)
==32359==    by 0x83596A7: g_object_unref (glib/gobject/gobject.c:2986)
==32359==    by 0x53F1C3: gimp_display_shell_filter_set (gimp-2-8/app/display/gimpdisplayshell-filter.c:58)
==32359==    by 0x536A50: gimp_display_shell_dispose (gimp-2-8/app/display/gimpdisplayshell.c:765)
parent e2510b2f
......@@ -334,6 +334,13 @@ gimp_color_display_editor_dispose (GObject *object)
{
GimpColorDisplayEditor *editor = GIMP_COLOR_DISPLAY_EDITOR (object);
if (editor->selected)
{
g_object_remove_weak_pointer (G_OBJECT (editor->selected),
(gpointer) &editor->selected);
editor->selected = NULL;
}
if (editor->stack)
{
g_object_unref (editor->stack);
......
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