[Bf-blender-cvs] [f094eb7c5f6] greasepencil-object: Fix memory leak

Antonio Vazquez noreply at git.blender.org
Tue Jan 2 13:35:30 CET 2018


Commit: f094eb7c5f6da4d321c69f6689d2a4cb48c7cc6e
Author: Antonio Vazquez
Date:   Tue Jan 2 13:35:13 2018 +0100
Branches: greasepencil-object
https://developer.blender.org/rBf094eb7c5f6da4d321c69f6689d2a4cb48c7cc6e

Fix memory leak

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

M	source/blender/blenkernel/intern/gpencil.c

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

diff --git a/source/blender/blenkernel/intern/gpencil.c b/source/blender/blenkernel/intern/gpencil.c
index 9b17dcafb00..0c377bf6981 100644
--- a/source/blender/blenkernel/intern/gpencil.c
+++ b/source/blender/blenkernel/intern/gpencil.c
@@ -519,7 +519,7 @@ static void gp_brush_curvemap_reset(CurveMap *cuma, int preset)
 		MEM_freeN(cuma->curve);
 
 	cuma->totpoint = 3;
-	cuma->curve = MEM_callocN(cuma->totpoint * sizeof(CurveMapPoint), "curve points");
+	cuma->curve = MEM_callocN(cuma->totpoint * sizeof(CurveMapPoint), __func__);
 
 	switch (preset) {
 		case GPCURVE_PRESET_PENCIL:
@@ -639,7 +639,7 @@ void BKE_gpencil_brush_init_presets(ToolSettings *ts)
 
 	/* Curve */
 	custom_curve = brush->cur_sensitivity;
-	curvemapping_set_defaults(custom_curve, 1, 0.0f, 0.0f, 1.0f, 1.0f);
+	curvemapping_set_defaults(custom_curve, 0, 0.0f, 0.0f, 1.0f, 1.0f);
 	curvemapping_initialize(custom_curve);
 	gp_brush_curvemap_reset(custom_curve->cm, GPCURVE_PRESET_INK);
 
@@ -669,7 +669,7 @@ void BKE_gpencil_brush_init_presets(ToolSettings *ts)
 
 	/* Curve */
 	custom_curve = brush->cur_sensitivity;
-	curvemapping_set_defaults(custom_curve, 1, 0.0f, 0.0f, 1.0f, 1.0f);
+	curvemapping_set_defaults(custom_curve, 0, 0.0f, 0.0f, 1.0f, 1.0f);
 	curvemapping_initialize(custom_curve);
 	gp_brush_curvemap_reset(custom_curve->cm, GPCURVE_PRESET_INKNOISE);



More information about the Bf-blender-cvs mailing list