diff options
author | Ton Roosendaal <ton@blender.org> | 2004-09-29 15:32:08 +0400 |
---|---|---|
committer | Ton Roosendaal <ton@blender.org> | 2004-09-29 15:32:08 +0400 |
commit | aa318f0bccaa460bafce21359c459cad73a473c5 (patch) | |
tree | 0ea4713a590cde6e9ce12f1892f8477ec04f34c3 /source/blender/src/editcurve.c | |
parent | ceb7d3db464377ac86e9ae92c8bd4a9ee09ddec2 (diff) |
Found potential crash in undo for Curve/Surface; the global var "lastnu"
wasn't restored on undo.
Diffstat (limited to 'source/blender/src/editcurve.c')
-rw-r--r-- | source/blender/src/editcurve.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/source/blender/src/editcurve.c b/source/blender/src/editcurve.c index fd4bf043eb3..458c47357c3 100644 --- a/source/blender/src/editcurve.c +++ b/source/blender/src/editcurve.c @@ -3997,7 +3997,11 @@ static void undoCurve_to_editCurve(void *lbv) { ListBase *lb= lbv; Nurb *nu, *newnu; + int nr, lastnunr= 0; + /* we try to restore lastnu too, for buttons */ + for(nu= editNurb.first; nu; nu = nu->next, lastnunr++) if(nu==lastnu) break; + freeNurblist(&editNurb); /* copy */ @@ -4007,6 +4011,9 @@ static void undoCurve_to_editCurve(void *lbv) BLI_addtail(&editNurb, newnu); nu= nu->next; } + /* restore */ + for(nr=0, lastnu= editNurb.first; lastnu; lastnu = lastnu->next, nr++) if(nr==lastnunr) break; + } static void *editCurve_to_undoCurve(void) |