mirror of https://github.com/GNOME/gimp.git
app: properly detach floating selection in dispose()
We crash when closing an image that has a floating selection and the GEGL projection is being used. Detach the floating selection when either the FS or the drawable it's attached to are disposed. This fix only makes it crash later, but makes sense as separate commit.
This commit is contained in:
parent
5c8ded8960
commit
e8f64664c9
|
@ -74,6 +74,7 @@ enum
|
|||
|
||||
static void gimp_drawable_pickable_iface_init (GimpPickableInterface *iface);
|
||||
|
||||
static void gimp_drawable_dispose (GObject *object);
|
||||
static void gimp_drawable_finalize (GObject *object);
|
||||
|
||||
static gint64 gimp_drawable_get_memsize (GimpObject *object,
|
||||
|
@ -218,6 +219,7 @@ gimp_drawable_class_init (GimpDrawableClass *klass)
|
|||
gimp_marshal_VOID__VOID,
|
||||
G_TYPE_NONE, 0);
|
||||
|
||||
object_class->dispose = gimp_drawable_dispose;
|
||||
object_class->finalize = gimp_drawable_finalize;
|
||||
|
||||
gimp_object_class->get_memsize = gimp_drawable_get_memsize;
|
||||
|
@ -275,12 +277,20 @@ gimp_drawable_pickable_iface_init (GimpPickableInterface *iface)
|
|||
}
|
||||
|
||||
static void
|
||||
gimp_drawable_finalize (GObject *object)
|
||||
gimp_drawable_dispose (GObject *object)
|
||||
{
|
||||
GimpDrawable *drawable = GIMP_DRAWABLE (object);
|
||||
|
||||
if (drawable->private->fs_opacity_node)
|
||||
gimp_drawable_sync_source_node (drawable, TRUE);
|
||||
if (gimp_drawable_get_floating_sel (drawable))
|
||||
gimp_drawable_detach_floating_sel (drawable);
|
||||
|
||||
G_OBJECT_CLASS (parent_class)->dispose (object);
|
||||
}
|
||||
|
||||
static void
|
||||
gimp_drawable_finalize (GObject *object)
|
||||
{
|
||||
GimpDrawable *drawable = GIMP_DRAWABLE (object);
|
||||
|
||||
if (drawable->private->tiles)
|
||||
{
|
||||
|
|
|
@ -402,6 +402,13 @@ gimp_layer_dispose (GObject *object)
|
|||
gimp_layer_layer_mask_update,
|
||||
layer);
|
||||
|
||||
if (gimp_layer_is_floating_sel (layer))
|
||||
{
|
||||
GimpDrawable *fs_drawable = gimp_layer_get_floating_sel_drawable (layer);
|
||||
|
||||
gimp_drawable_detach_floating_sel (fs_drawable);
|
||||
}
|
||||
|
||||
G_OBJECT_CLASS (parent_class)->dispose (object);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue