Revision: 53302
          
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=53302
Author:   ton
Date:     2012-12-23 18:41:00 +0000 (Sun, 23 Dec 2012)
Log Message:
-----------
Patch for weirdo library recursive linking errors:

In case you accidentally link data in a library file from the main file, 
Blender would crash.
Now it survives, giving error messages to tell what to fix.

Modified Paths:
--------------
    trunk/blender/source/blender/blenloader/intern/readfile.c

Modified: trunk/blender/source/blender/blenloader/intern/readfile.c
===================================================================
--- trunk/blender/source/blender/blenloader/intern/readfile.c   2012-12-23 
16:09:26 UTC (rev 53301)
+++ trunk/blender/source/blender/blenloader/intern/readfile.c   2012-12-23 
18:41:00 UTC (rev 53302)
@@ -8747,7 +8747,15 @@
                                Library *lib = read_struct(fd, bheadlib, 
"Library");
                                Main *ptr = blo_find_main(fd, lib->name, 
fd->relabase);
                                
-                               id = is_yet_read(fd, ptr, bhead);
+                               if (ptr->curlib == NULL) {
+                                       const char *idname= bhead_id_name(fd, 
bhead);
+                                       
+                                       BKE_reportf_wrap(fd->reports, 
RPT_WARNING, TIP_("LIB ERROR: Data refers to main .blend file: '%s' from %s"),
+                                                        idname, 
mainvar->curlib->filepath);
+                                       return;
+                               }
+                               else
+                                       id = is_yet_read(fd, ptr, bhead);
                                
                                if (id == NULL) {
                                        read_libblock(fd, ptr, bhead, 
LIB_READ+LIB_INDIRECT, NULL);

_______________________________________________
Bf-blender-cvs mailing list
[email protected]
http://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to