GNOME Bugzilla – Bug 795909
Multiple images opened with floating selection - closing one of them crashes GIMP
Last modified: 2018-05-08 14:25:56 UTC
The crash may be caused in a following way: 1) Open two new images (Ctrl+N) - single non-transparent layer is enough. 2) Paste anything into both pictures (image in the clipboard or anything what was already drawn in the picture). Currently we have two images opened and in both of them a floating selection (pasted layer) is present. 4) Edit the floating selection in one of the images with any tool, then close this image (I always discarded changes) 5) GIMP crashes.
Thanks. Fixed in master: commit bc09c718186de42795b7cd9562766c5dc01cbe5e Author: Ell <ell_se@yahoo.com> Date: Tue May 8 10:11:25 2018 -0400 Bug 795909 - Multiple images opened with floating selection ... ... closing one of them crashes GIMP GimpSymmetry keeps a strong reference to the drawable passed to gimp_symmetry_set_origin() until the next call to set_origin(), or until it's destroyed. This can unnecessarily extend the lifetime of the drawable. In particular, it can extend the lifetime of a floating selection past the destruction of the image mask, during image destruction, which results in a NULL mask pointer in gimp_layer_invalidate_boundary(), called when detaching the floating selection as part of its destructor. Add gimp_symmetry_clear_origin(), which clears the origin set using gimp_symmetry_set_origin(), dropping the reference to the drawable, and call it in gimp_paint_core_paint() after painting. This avoids extending the lifetime of the drawable, and fixes the bug. app/core/gimpsymmetry.c | 26 ++++++++++++++++++++------ app/core/gimpsymmetry.h | 1 + app/paint/gimppaintcore.c | 1 + 3 files changed, 22 insertions(+), 6 deletions(-)