diff options
author | Campbell Barton <ideasman42@gmail.com> | 2007-12-24 13:25:35 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2007-12-24 13:25:35 +0300 |
commit | df46987ba3936b9f3a13f221cfbfc60696fef2bc (patch) | |
tree | 296062473e54c8a61df9019c116659e8f1901ab3 /source/blender/src/header_info.c | |
parent | 2b49858b0225e1b173c75b6c16c620542fcc2003 (diff) |
old bug in python api, Blender.Scene.Unlink() did not check if screens were using this scene or if it was used as a set elsewhere.
In both cases this resulted in invalid pointers and crashes.
Also was not freeing nodes or sequence data.
Diffstat (limited to 'source/blender/src/header_info.c')
-rw-r--r-- | source/blender/src/header_info.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/source/blender/src/header_info.c b/source/blender/src/header_info.c index fd7495dbbbe..174a5c683f0 100644 --- a/source/blender/src/header_info.c +++ b/source/blender/src/header_info.c @@ -484,18 +484,19 @@ void do_info_buttons(unsigned short event) else if(G.scene->id.next) sce= G.scene->id.next; else return; if(okee("Delete current scene")) { + /* Note, anything besides free_libblock needs to be added in + * Python Scene.c for Blender.Scene.Unlink() */ + /* exit modes... could become single call once */ exit_editmode(EM_FREEDATA|EM_WAITCURSOR); exit_paint_modes(); /* check all sets */ - sce1= G.main->scene.first; - while(sce1) { + for (sce1= G.main->scene.first; sce1; sce1= sce1->id.next) { if(sce1->set == G.scene) sce1->set= 0; - sce1= sce1->id.next; } - + /* check all sequences */ clear_scene_in_allseqs(G.scene); @@ -503,10 +504,9 @@ void do_info_buttons(unsigned short event) clear_scene_in_nodes(G.scene); /* al screens */ - sc= G.main->screen.first; - while(sc) { + + for (sc= G.main->screen.first; sc; sc= sc->id.next ) { if(sc->scene == G.scene) sc->scene= sce; - sc= sc->id.next; } free_libblock(&G.main->scene, G.scene); set_scene(sce); |