mirror of https://github.com/GNOME/gimp.git
app: fix random crash when GimpColorHistory is finalized.
I encountered this one when closing GIMP. Issue #9591 seems to be the same crash, though when just closing the Colors dockable. I fail to reproduce willingly now, though it looks like the problem could happen in some cases when the stored GimpContext is freed before GimpColorHistory is freed. Let's increment the reference to make sure the referenced object stays alive as long the history is alive.
This commit is contained in:
parent
970fc86548
commit
f75e0aa321
|
@ -187,6 +187,8 @@ gimp_color_history_finalize (GObject *object)
|
|||
g_signal_handlers_disconnect_by_func (history->context,
|
||||
gimp_color_history_image_changed,
|
||||
history);
|
||||
g_clear_object (&history->context);
|
||||
|
||||
if (history->active_image)
|
||||
g_signal_handlers_disconnect_by_func (history->active_image,
|
||||
G_CALLBACK (gimp_color_history_palette_dirty),
|
||||
|
@ -222,7 +224,7 @@ gimp_color_history_set_property (GObject *object,
|
|||
history->active_image = NULL;
|
||||
}
|
||||
|
||||
history->context = g_value_get_object (value);
|
||||
history->context = g_value_dup_object (value);
|
||||
|
||||
if (history->context)
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue