[Bf-blender-cvs] [5afc247ea18] master: Fix image paint undo memory leak

Campbell Barton noreply at git.blender.org
Thu Jan 31 02:33:03 CET 2019


Commit: 5afc247ea183488f6b5cd22f659a21e87a68ddbb
Author: Campbell Barton
Date:   Thu Jan 31 12:35:12 2019 +1100
Branches: master
https://developer.blender.org/rB5afc247ea183488f6b5cd22f659a21e87a68ddbb

Fix image paint undo memory leak

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

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

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

diff --git a/source/blender/editors/sculpt_paint/paint_image_undo.c b/source/blender/editors/sculpt_paint/paint_image_undo.c
index 25f5d91a928..0cf56726abf 100644
--- a/source/blender/editors/sculpt_paint/paint_image_undo.c
+++ b/source/blender/editors/sculpt_paint/paint_image_undo.c
@@ -346,10 +346,10 @@ static void image_undo_restore_list(ListBase *lb, struct UndoIDPtrMap *id_map)
 
 static void image_undo_free_list(ListBase *lb)
 {
-	UndoImageTile *tile;
-
-	for (tile = lb->first; tile; tile = tile->next) {
+	for (UndoImageTile *tile = lb->first, *tile_next; tile; tile = tile_next) {
+		tile_next = tile->next;
 		MEM_freeN(tile->rect.pt);
+		MEM_freeN(tile);
 	}
 }



More information about the Bf-blender-cvs mailing list