From 2b3c8bdc27121e6c9103b26cffd705cee9e20b4a Mon Sep 17 00:00:00 2001 From: Joshua Leung Date: Sat, 7 Aug 2010 10:18:59 +0000 Subject: Bugfix #23216: Memory leak when removing Fcurve from action Missing call to free_fcurve() --- source/blender/makesrna/intern/rna_action.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'source') diff --git a/source/blender/makesrna/intern/rna_action.c b/source/blender/makesrna/intern/rna_action.c index db71fbd8c46..027ecfc12a3 100644 --- a/source/blender/makesrna/intern/rna_action.c +++ b/source/blender/makesrna/intern/rna_action.c @@ -108,20 +108,21 @@ static FCurve *rna_Action_fcurve_new(bAction *act, ReportList *reports, char *da static void rna_Action_fcurve_remove(bAction *act, ReportList *reports, FCurve *fcu) { - if(fcu->grp) { + if (fcu->grp) { if (BLI_findindex(&act->groups, fcu->grp) == -1) { BKE_reportf(reports, RPT_ERROR, "FCurve's ActionGroup '%s' not found in action '%s'", fcu->grp->name, act->id.name+2); return; } - + action_groups_remove_channel(act, fcu); + free_fcurve(fcu); } else { - if(BLI_findindex(&act->curves, fcu) == -1) { + if (BLI_findindex(&act->curves, fcu) == -1) { BKE_reportf(reports, RPT_ERROR, "FCurve not found in action '%s'", act->id.name+2); return; } - + BLI_remlink(&act->curves, fcu); free_fcurve(fcu); } -- cgit v1.2.3