[Bf-blender-cvs] [82d2de2] gsoc2016-improved_extrusion: Curves: Trim operator

João Araújo noreply at git.blender.org
Wed Jul 20 00:12:45 CEST 2016


Commit: 82d2de2cef2a5c68bff69e43dec59b17bc093651
Author: João Araújo
Date:   Tue Jul 19 23:11:56 2016 +0100
Branches: gsoc2016-improved_extrusion
https://developer.blender.org/rB82d2de2cef2a5c68bff69e43dec59b17bc093651

Curves: Trim operator

Fixed memory leaks (WIP).

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

M	source/blender/editors/curve/editcurve.c

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

diff --git a/source/blender/editors/curve/editcurve.c b/source/blender/editors/curve/editcurve.c
index fb31bcb..4b697d7 100644
--- a/source/blender/editors/curve/editcurve.c
+++ b/source/blender/editors/curve/editcurve.c
@@ -6782,7 +6782,8 @@ static ListBase *spline_X_shape(Object *obedit, int selected_spline)
 	float *coord_array, *full_coord_array, *vi, helper[3], *segment_coord_array;
 	int i = 0, a = 0, j = 0, k = 0;
 	intersections = (ListBase *)MEM_callocN(sizeof(ListBase), "splineXshape2");
-	full_coord_array = (float *)MEM_callocN(3 * (nu->pntsu * nu->resolu - 1) * sizeof(float), "splineXshape3");
+	full_coord_array = (float *)MEM_callocN(3 * ((nu->pntsu - 1 + nu->flagu) * nu->resolu + 1) * sizeof(float), "splineXshape3");
+
 
 	/* get the full coord_array for nu */
 	float *original_first_coord_array;
@@ -7088,7 +7089,7 @@ static int trim_curve_exec(bContext *C, wmOperator *op)
 		int high_first_order = ((XShape *)((LinkData *)high->first)->data)->order;
 
 		Nurb *new_spl = BKE_nurb_duplicate(nu);
-		new_spl->bezt = (BezTriple *)MEM_callocN(npoints * sizeof(BezTriple), "trimexec5");
+		// new_spl->bezt = (BezTriple *)MEM_callocN(npoints * sizeof(BezTriple), "trimexec5");
 		new_spl->pntsu = npoints;
 		BezTriple *bezt = new_spl->bezt;
 		for (int i = 0; i < new_spl->pntsu; i++) {
@@ -7304,6 +7305,8 @@ static int trim_curve_exec(bContext *C, wmOperator *op)
 		}
 	}
 
+	
+
 	WM_event_add_notifier(C, NC_GEOM | ND_DATA, obedit->data);
 	DAG_id_tag_update(obedit->data, 0);




More information about the Bf-blender-cvs mailing list