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-12-08 21:36:48 +0300
committerTon Roosendaal <ton@blender.org>2004-12-08 21:36:48 +0300
commitef4ac2b592a62b4c160b764acdffe5fa1d9a4b9b (patch)
treeb3189a33a045b4b6512a22530637c5358eb1c003 /source/blender/blenloader
parentb6f5420e8bde2131a9adbea4306f7fb276feab4e (diff)
Narrowed code for restoring UI after undo. It seems still an error in
oops code, having pointers to ID structs that are invalid. This solves at least it crashing... oops needs to be refreshed once :) (occurred on testing complex files, with conversion from nurbs=>mesh)
Diffstat (limited to 'source/blender/blenloader')
-rw-r--r--source/blender/blenloader/intern/readfile.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c
index 140a48acef2..d2551bf484d 100644
--- a/source/blender/blenloader/intern/readfile.c
+++ b/source/blender/blenloader/intern/readfile.c
@@ -2700,13 +2700,16 @@ static void *restore_pointer_by_name(Main *mainp, ID *id, int user)
if(id) {
lb= wich_libbase(mainp, GS(id->name));
- idn= lb->first;
- while(idn) {
- if( strcmp(idn->name, id->name)==0) {
- if(user && idn->us==0) idn->us++;
- break;
+
+ if(lb) { // there's still risk of checking corrupt mem (freed Ids in oops)
+ idn= lb->first;
+ while(idn) {
+ if( strcmp(idn->name, id->name)==0) {
+ if(user && idn->us==0) idn->us++;
+ break;
+ }
+ idn= idn->next;
}
- idn= idn->next;
}
}
return idn;