Revision: 14608
          
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=14608
Author:   campbellbarton
Date:     2008-04-28 23:54:03 +0200 (Mon, 28 Apr 2008)

Log Message:
-----------
running scripts in background mode would crash blender when checking a 
scriptspace areas

Modified Paths:
--------------
    trunk/blender/source/blender/python/BPY_interface.c

Modified: trunk/blender/source/blender/python/BPY_interface.c
===================================================================
--- trunk/blender/source/blender/python/BPY_interface.c 2008-04-28 21:29:15 UTC 
(rev 14607)
+++ trunk/blender/source/blender/python/BPY_interface.c 2008-04-28 21:54:03 UTC 
(rev 14608)
@@ -639,11 +639,13 @@
                if( !strcmp( script->id.name + 2, text->id.name + 2 ) ) {
                        /* if this text is already a running script, 
                         * just move to it: */
-                       SpaceScript *sc;
-                       newspace( curarea, SPACE_SCRIPT );
-                       sc = curarea->spacedata.first;
-                       sc->script = script;
-                       return 1;
+                       if (!G.background) {
+                               SpaceScript *sc;
+                               newspace( curarea, SPACE_SCRIPT );
+                               sc = curarea->spacedata.first;
+                               sc->script = script;
+                               return 1;
+                       }
                }
                script = script->id.next;
        }
@@ -943,10 +945,12 @@
 
                        /* special case: called from the menu in the Scripts 
window
                         * we have to change sc->script pointer, since it'll be 
freed here.*/
-                       if( curarea->spacetype == SPACE_SCRIPT ) {
-                               SpaceScript *sc = curarea->spacedata.first;
-                               sc->script = G.main->script.first;      /* can 
be null, which is ok ... */
-                               /* ... meaning no other script is running right 
now. */
+                       if (!G.background) {
+                               if( curarea->spacetype == SPACE_SCRIPT ) {
+                                       SpaceScript *sc = 
curarea->spacedata.first;
+                                       sc->script = G.main->script.first;      
/* can be null, which is ok ... */
+                                       /* ... meaning no other script is 
running right now. */
+                               }
                        }
 
                }


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

Reply via email to