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:
authorCampbell Barton <ideasman42@gmail.com>2015-02-12 13:31:36 +0300
committerCampbell Barton <ideasman42@gmail.com>2015-02-12 13:33:59 +0300
commit7f47cd9b174627ef08cc642bde349b8018e87c55 (patch)
tree565525dab97328f6bab2549bb6137713fdbf257c /source/blender/blenkernel/intern/blender.c
parentb2b54b0902045ec4f0c1a4cae3209be863878f5b (diff)
Correct fix for T43424
Would crash undoing adding a new scene in camera view.
Diffstat (limited to 'source/blender/blenkernel/intern/blender.c')
-rw-r--r--source/blender/blenkernel/intern/blender.c23
1 files changed, 14 insertions, 9 deletions
diff --git a/source/blender/blenkernel/intern/blender.c b/source/blender/blenkernel/intern/blender.c
index dda790ea700..b6ea780576e 100644
--- a/source/blender/blenkernel/intern/blender.c
+++ b/source/blender/blenkernel/intern/blender.c
@@ -258,23 +258,28 @@ static void setup_app_data(bContext *C, BlendFileData *bfd, const char *filepath
SWAP(ListBase, G.main->screen, bfd->main->screen);
SWAP(ListBase, G.main->script, bfd->main->script);
+ /* we re-use current screen */
curscreen = CTX_wm_screen(C);
+ /* but use new Scene pointer */
+ curscene = bfd->curscene;
track_undo_scene = (mode == LOAD_UNDO && curscreen && bfd->main->wm.first);
- if (track_undo_scene) {
- curscene = curscreen->scene;
- }
- else {
- /* but use new Scene pointer */
- curscene = bfd->curscene;
- }
if (curscene == NULL) curscene = bfd->main->scene.first;
/* empty file, we add a scene to make Blender work */
if (curscene == NULL) curscene = BKE_scene_add(bfd->main, "Empty");
- /* and we enforce curscene to be in current screen */
- if (curscreen) curscreen->scene = curscene; /* can run in bgmode */
+ if (track_undo_scene) {
+ /* keep the old (free'd) scene, let 'blo_lib_link_screen_restore'
+ * replace it with 'curscene' if its needed */
+ }
+ else {
+ /* and we enforce curscene to be in current screen */
+ if (curscreen) {
+ /* can run in bgmode */
+ curscreen->scene = curscene;
+ }
+ }
/* clear_global will free G.main, here we can still restore pointers */
blo_lib_link_screen_restore(bfd->main, curscreen, curscene);