[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [31139] trunk/blender/source/blender/ makesrna/intern/rna_action.c: Bugfix #23216: Memory leak when removing Fcurve from action

Joshua Leung aligorith at gmail.com
Sat Aug 7 12:18:59 CEST 2010


Revision: 31139
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=31139
Author:   aligorith
Date:     2010-08-07 12:18:59 +0200 (Sat, 07 Aug 2010)

Log Message:
-----------
Bugfix #23216: Memory leak when removing Fcurve from action

Missing call to free_fcurve()

Modified Paths:
--------------
    trunk/blender/source/blender/makesrna/intern/rna_action.c

Modified: trunk/blender/source/blender/makesrna/intern/rna_action.c
===================================================================
--- trunk/blender/source/blender/makesrna/intern/rna_action.c	2010-08-07 08:22:03 UTC (rev 31138)
+++ trunk/blender/source/blender/makesrna/intern/rna_action.c	2010-08-07 10:18:59 UTC (rev 31139)
@@ -108,20 +108,21 @@
 
 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);
 	}





More information about the Bf-blender-cvs mailing list