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:
authorMitchell Stokes <mogurijin@gmail.com>2014-02-24 00:44:33 +0400
committerMitchell Stokes <mogurijin@gmail.com>2014-02-24 00:44:33 +0400
commit411650f2faab16e9f4e6f0fdba27ff278d25e61a (patch)
treefee78887b4c97ef8e17f568cc03674c5242b5057 /source/gameengine/Ketsji/KX_PythonInit.cpp
parent8be628cf7f732c53bc73f479815346d352bae16a (diff)
Partial fix for T3817: BGE crashing when using LibNew.
The BGE needs to use BKE_main_new() isntead of calloc for allocating a Main struct since the threaded depsgraph changes.
Diffstat (limited to 'source/gameengine/Ketsji/KX_PythonInit.cpp')
-rw-r--r--source/gameengine/Ketsji/KX_PythonInit.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/source/gameengine/Ketsji/KX_PythonInit.cpp b/source/gameengine/Ketsji/KX_PythonInit.cpp
index 5d0c6a8bb83..234d03ab618 100644
--- a/source/gameengine/Ketsji/KX_PythonInit.cpp
+++ b/source/gameengine/Ketsji/KX_PythonInit.cpp
@@ -130,6 +130,7 @@ extern "C" {
#include "PHY_IPhysicsEnvironment.h"
#include "BKE_main.h"
#include "BKE_global.h"
+#include "BKE_library.h"
#include "BLI_blenlib.h"
#include "GPU_material.h"
#include "MEM_guardedalloc.h"
@@ -752,7 +753,7 @@ static PyObject *gLibNew(PyObject *, PyObject *args)
return NULL;
}
- Main *maggie= (Main *)MEM_callocN( sizeof(Main), "BgeMain");
+ Main *maggie=BKE_main_new();
kx_scene->GetSceneConverter()->GetMainDynamic().push_back(maggie);
strncpy(maggie->name, path, sizeof(maggie->name)-1);