[gimp] plug-ins: in file-tiff, don't leak image when not saving layers



commit 8831ef2ea099c2224102105a8148c4c0a9687a11
Author: Ell <ell_se yahoo com>
Date:   Mon Jun 3 12:36:36 2019 -0400

    plug-ins: in file-tiff, don't leak image when not saving layers
    
    In file-tiff, when not saving layers, avoid duplicating the image
    to create the merged version if it's already been duplicated, and
    make sure to delete the duplicated image otherwise.

 plug-ins/file-tiff/file-tiff.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)
---
diff --git a/plug-ins/file-tiff/file-tiff.c b/plug-ins/file-tiff/file-tiff.c
index dbaa6a153d..f327e9ddb9 100644
--- a/plug-ins/file-tiff/file-tiff.c
+++ b/plug-ins/file-tiff/file-tiff.c
@@ -478,8 +478,13 @@ run (const gchar      *name,
             {
               gint32 transp;
 
-              /* FIXME: Do we have to update drawable, too? */
-              image = gimp_image_duplicate (image);
+              if (export != GIMP_EXPORT_EXPORT)
+                {
+                  image    = gimp_image_duplicate (image);
+                  drawable = gimp_image_get_active_layer (image);
+
+                  export = GIMP_EXPORT_EXPORT;
+                }
 
               /* borrowed from ./libgimp/gimpexport.c:export_merge()
                * this makes sure that the exported file size is correct. */


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]