app: don't detach the floating selection if it's not attached

Fix the commit two down in the log: a layer can be a floating
selection even if it's not attached to anything (when it is on the
undo stack).  Don't detach it if it is not the underlying drawable's
current fs.
This commit is contained in:
Michael Natterer 2011-09-23 22:24:23 +02:00
parent 208fedd7ea
commit 578e6402b8
1 changed files with 5 additions and 1 deletions

View File

@ -406,7 +406,11 @@ gimp_layer_dispose (GObject *object)
{
GimpDrawable *fs_drawable = gimp_layer_get_floating_sel_drawable (layer);
gimp_drawable_detach_floating_sel (fs_drawable);
/* only detach if this is actually the drawable's fs because the
* layer might be on the undo stack and not attached to anyhing
*/
if (gimp_drawable_get_floating_sel (fs_drawable) == layer)
gimp_drawable_detach_floating_sel (fs_drawable);
}
G_OBJECT_CLASS (parent_class)->dispose (object);