[Bf-blender-cvs] [2309def] master: Fix crash when changing worlds with world background active.
Antony Riakiotakis
noreply at git.blender.org
Thu Dec 11 14:43:24 CET 2014
Commit: 2309def874da2986d1bc31b1233671936bcd39f1
Author: Antony Riakiotakis
Date: Thu Dec 11 14:35:10 2014 +0100
Branches: master
https://developer.blender.org/rB2309def874da2986d1bc31b1233671936bcd39f1
Fix crash when changing worlds with world background active.
Freeing the preview will free the original gpu material so NULL that out
on copy.
===================================================================
M source/blender/blenkernel/intern/world.c
===================================================================
diff --git a/source/blender/blenkernel/intern/world.c b/source/blender/blenkernel/intern/world.c
index 2a31cb7..8113e2b 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;
}
More information about the Bf-blender-cvs
mailing list