[Bf-blender-cvs] [8583793] GPencil_EditStrokes: Fix memory leak when deleting entire strokes using "points" mode

Joshua Leung noreply at git.blender.org
Wed Nov 5 07:37:03 CET 2014


Commit: 85837937a00a6e16defd2bc43cf019b4437a63f8
Author: Joshua Leung
Date:   Wed Nov 5 19:36:14 2014 +1300
Branches: GPencil_EditStrokes
https://developer.blender.org/rB85837937a00a6e16defd2bc43cf019b4437a63f8

Fix memory leak when deleting entire strokes using "points" mode

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

M	source/blender/editors/gpencil/gpencil_edit.c

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

diff --git a/source/blender/editors/gpencil/gpencil_edit.c b/source/blender/editors/gpencil/gpencil_edit.c
index f07d35d..ba37ee8 100644
--- a/source/blender/editors/gpencil/gpencil_edit.c
+++ b/source/blender/editors/gpencil/gpencil_edit.c
@@ -792,7 +792,7 @@ static int gp_dissolve_selected_points(bContext *C)
 					/* just copy all unselected into a smaller buffer */
 					bGPDspoint *new_points = MEM_callocN(sizeof(bGPDspoint) * tot, "new gp stroke points copy");
 					bGPDspoint *npt        = new_points;
-							
+					
 					for (i = 0, pt = gps->points; i < gps->totpoints; i++, pt++) {
 						if ((pt->flag & GP_SPOINT_SELECT) == 0) {
 							*npt = *pt;
@@ -919,12 +919,11 @@ static int gp_delete_selected_points(bContext *C)
 							BLI_addtail(&gpf->strokes, new_stroke);
 						}
 					}
-					
-					/* free islands */
-					MEM_freeN(islands);
-					islands = NULL;
 				}
 				
+				/* free islands */
+				MEM_freeN(islands);
+				
 				/* Delete the old stroke */
 				MEM_freeN(gps->points);
 				BLI_freelinkN(&gpf->strokes, gps);




More information about the Bf-blender-cvs mailing list