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



commit a95c1690911e20b45e95d20a3218205fcebcab52
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()

 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]