Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTon Roosendaal <ton@blender.org>2004-11-25 18:48:19 +0300
committerTon Roosendaal <ton@blender.org>2004-11-25 18:48:19 +0300
commit2ca8c680a771bbfa9b27447828369fb3c1c60153 (patch)
treeecbd03c8644c473b3e055c641c04febf7bb20dee /source/blender/src/editmode_undo.c
parentb16a1c5ad266bc9f981673b59ced2b20b9a54495 (diff)
Bugfix #1889
Reporter found omission in editmode undo. When you convert objects from Font to Curve and/or to Mesh, the stack wasn't cleared (same object pointer!) giving crashes on undo-restore calls. Nice discovery. :)
Diffstat (limited to 'source/blender/src/editmode_undo.c')
-rw-r--r--source/blender/src/editmode_undo.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/source/blender/src/editmode_undo.c b/source/blender/src/editmode_undo.c
index 9d55c6b314c..9d905f0a0ef 100644
--- a/source/blender/src/editmode_undo.c
+++ b/source/blender/src/editmode_undo.c
@@ -100,6 +100,7 @@ typedef struct UndoElem {
struct UndoElem *next, *prev;
ID id; // copy of editmode object ID
Object *ob; // pointer to edited object
+ int type; // type of edited object
void *undodata;
char name[MAXUNDONAME];
void (*freedata)(void *);
@@ -133,7 +134,7 @@ void undo_editmode_push(char *name, void (*freedata)(void *),
/* prevent two same undocalls */
if(curundo && strcmp("Original", name)==0) {
- if( curundo->ob==G.obedit ) {
+ if( curundo->ob==G.obedit && curundo->type==G.obedit->type) {
return;
}
}
@@ -175,6 +176,7 @@ void undo_editmode_push(char *name, void (*freedata)(void *),
curundo->undodata= curundo->from_editmode();
curundo->ob= G.obedit;
curundo->id= G.obedit->id;
+ curundo->type= G.obedit->type;
}
@@ -191,8 +193,8 @@ static void undo_clean_stack(void)
while(uel) {
next= uel->next;
- /* for when global undo changes pointers... */
- if(strcmp(uel->id.name, G.obedit->id.name)==0) {
+ /* for when objects are converted, renamed, or global undo changes pointers... */
+ if(uel->type==G.obedit->type && strcmp(uel->id.name, G.obedit->id.name)==0) {
uel->ob= G.obedit;
}
else {