[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [33513] trunk/blender/source/blender/ editors/curve/editcurve.c: Update curve animation data when loading UndoCurve -- fixes memory corruption

Sergey Sharybin g.ulairi at gmail.com
Mon Dec 6 18:49:57 CET 2010


Revision: 33513
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=33513
Author:   nazgul
Date:     2010-12-06 18:49:57 +0100 (Mon, 06 Dec 2010)

Log Message:
-----------
Update curve animation data when loading UndoCurve -- fixes memory corruption
when starting playback after undo-ing topology changes

The simpliest way was to change data at which undoCurve_to_editCurve and
editCurve_to_undoCurve works from curve to object. Maybe it's not very
cool, but still better than moving curve animation handlers outside of
editcurve module.

Modified Paths:
--------------
    trunk/blender/source/blender/editors/curve/editcurve.c

Modified: trunk/blender/source/blender/editors/curve/editcurve.c
===================================================================
--- trunk/blender/source/blender/editors/curve/editcurve.c	2010-12-06 17:41:12 UTC (rev 33512)
+++ trunk/blender/source/blender/editors/curve/editcurve.c	2010-12-06 17:49:57 UTC (rev 33513)
@@ -6695,9 +6695,10 @@
 	return NULL;
 }
 
-static void undoCurve_to_editCurve(void *ucu, void *cue)
+static void undoCurve_to_editCurve(void *ucu, void *obe)
 {
-	Curve *cu= cue;
+	Object *obedit= obe;
+	Curve *cu= (Curve*)obedit->data;
 	UndoCurve *undoCurve= ucu;
 	ListBase *undobase= &undoCurve->nubase;
 	ListBase *editbase= ED_curve_editnurbs(cu);
@@ -6728,11 +6729,14 @@
 	}
 
 	cu->lastsel= lastsel;
+
+	ED_curve_updateAnimPaths(obedit);
 }
 
-static void *editCurve_to_undoCurve(void *cue)
+static void *editCurve_to_undoCurve(void *obe)
 {
-	Curve *cu= cue;
+	Object *obedit= obe;
+	Curve *cu= (Curve*)obedit->data;
 	ListBase *nubase= ED_curve_editnurbs(cu);
 	UndoCurve *undoCurve;
 	EditNurb *editnurb= cu->editnurb, tmpEditnurb;
@@ -6782,7 +6786,7 @@
 static void *get_data(bContext *C)
 {
 	Object *obedit= CTX_data_edit_object(C);
-	return obedit->data;
+	return obedit;
 }
 
 /* and this is all the undo system needs to know */





More information about the Bf-blender-cvs mailing list