[gimp/gimp-2-10] app: don't unref a NULL GimpTempBuf in gimp_pattern_copy()



commit 376b053129432fef66afd7144585522d9066b8bb
Author: Michael Natterer <mitch gimp org>
Date:   Tue Feb 12 21:15:35 2019 +0100

    app: don't unref a NULL GimpTempBuf in gimp_pattern_copy()
    
    (cherry picked from commit a95c1690911e20b45e95d20a3218205fcebcab52)

 app/core/gimppattern.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
---
diff --git a/app/core/gimppattern.c b/app/core/gimppattern.c
index bcc0332e3c..31772111b7 100644
--- a/app/core/gimppattern.c
+++ b/app/core/gimppattern.c
@@ -195,8 +195,7 @@ gimp_pattern_copy (GimpData *data,
   GimpPattern *pattern     = GIMP_PATTERN (data);
   GimpPattern *src_pattern = GIMP_PATTERN (src_data);
 
-  gimp_temp_buf_unref (pattern->mask);
-
+  g_clear_pointer (&pattern->mask, gimp_temp_buf_unref);
   pattern->mask = gimp_temp_buf_copy (src_pattern->mask);
 
   gimp_data_dirty (data);


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