[Bf-blender-cvs] [d2ff21e75de] blender-v2.82-release: Fix memory leak with 2D image painting

Campbell Barton noreply at git.blender.org
Tue Feb 11 12:14:43 CET 2020


Commit: d2ff21e75de906d90f3d338871ca35756e94bfea
Author: Campbell Barton
Date:   Tue Feb 11 22:11:51 2020 +1100
Branches: blender-v2.82-release
https://developer.blender.org/rBd2ff21e75de906d90f3d338871ca35756e94bfea

Fix memory leak with 2D image painting

Regression from c30d6571bb477

===================================================================

M	source/blender/editors/sculpt_paint/paint_image_2d.c

===================================================================

diff --git a/source/blender/editors/sculpt_paint/paint_image_2d.c b/source/blender/editors/sculpt_paint/paint_image_2d.c
index 7f71110b360..a667c7062e6 100644
--- a/source/blender/editors/sculpt_paint/paint_image_2d.c
+++ b/source/blender/editors/sculpt_paint/paint_image_2d.c
@@ -1646,7 +1646,7 @@ void paint_2d_stroke(void *ps,
       continue;
     }
 
-    ImBuf *ibuf = BKE_image_acquire_ibuf(s->image, &tile->iuser, NULL);
+    ImBuf *ibuf = tile->canvas;
 
     /* OCIO_TODO: float buffers are now always linear, so always use color correction
      *            this should probably be changed when texture painting color space is supported
@@ -1711,6 +1711,7 @@ void *paint_2d_new_stroke(bContext *C, wmOperator *op, int mode)
   }
 
   if (ibuf->channels != 4) {
+    BKE_image_release_ibuf(s->image, ibuf, NULL);
     BKE_report(op->reports, RPT_WARNING, "Image requires 4 color channels to paint");
     MEM_freeN(s->tiles);
     MEM_freeN(s);



More information about the Bf-blender-cvs mailing list