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:
authorAntony Riakiotakis <kalast@gmail.com>2014-12-11 16:35:10 +0300
committerAntony Riakiotakis <kalast@gmail.com>2014-12-11 16:43:15 +0300
commit2309def874da2986d1bc31b1233671936bcd39f1 (patch)
tree903b07b87e3a17fd17e33aae807b9eafd9dbeffa /source/blender/blenkernel/intern/world.c
parent754bdbe4b41c6c04ed69c4061f4bf4f33013d224 (diff)
Fix crash when changing worlds with world background active.
Freeing the preview will free the original gpu material so NULL that out on copy.
Diffstat (limited to 'source/blender/blenkernel/intern/world.c')
-rw-r--r--source/blender/blenkernel/intern/world.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/source/blender/blenkernel/intern/world.c b/source/blender/blenkernel/intern/world.c
index 2a31cb7b429..8113e2bf9ef 100644
--- a/source/blender/blenkernel/intern/world.c
+++ b/source/blender/blenkernel/intern/world.c
@@ -39,6 +39,7 @@
#include "DNA_texture_types.h"
#include "BLI_utildefines.h"
+#include "BLI_listbase.h"
#include "BKE_animsys.h"
#include "BKE_global.h"
@@ -138,6 +139,8 @@ World *BKE_world_copy(World *wrld)
if (wrld->preview)
wrldn->preview = BKE_previewimg_copy(wrld->preview);
+ BLI_listbase_clear(&wrldn->gpumaterial);
+
return wrldn;
}
@@ -162,6 +165,8 @@ World *localize_world(World *wrld)
wrldn->preview = NULL;
+ BLI_listbase_clear(&wrldn->gpumaterial);
+
return wrldn;
}