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
path: root/intern
diff options
context:
space:
mode:
authorDalai Felinto <dfelinto@gmail.com>2014-05-23 03:18:45 +0400
committerDalai Felinto <dfelinto@gmail.com>2014-05-23 03:18:48 +0400
commitdd96205d0aaae39e8d49cae2a0b4a63b34a8c39d (patch)
tree029874c6705d1440c639f8a2e2f735b129e951da /intern
parent81b129d3b837e31c0d6d2a9d2a6e39d39e47c1ec (diff)
fix T40323 Segfault on baking after rendering
The remaining functions in blender_python.cpp changed from using the MACRO to use python_thread_state_save/python_thread_state_restore Since this bug only happens when 'Persistent Images' is on it was introduced in some of the early merges with master and I never caught it. Thanks Daniel Salazar for helping with the bug hunting.
Diffstat (limited to 'intern')
-rw-r--r--intern/cycles/blender/blender_python.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/intern/cycles/blender/blender_python.cpp b/intern/cycles/blender/blender_python.cpp
index 872f891cc2a..6148f49a4b4 100644
--- a/intern/cycles/blender/blender_python.cpp
+++ b/intern/cycles/blender/blender_python.cpp
@@ -158,8 +158,6 @@ static PyObject *bake_func(PyObject *self, PyObject *args)
if(!PyArg_ParseTuple(args, "OOsOiiO", &pysession, &pyobject, &pass_type, &pypixel_array, &num_pixels, &depth, &pyresult))
return NULL;
- Py_BEGIN_ALLOW_THREADS
-
BlenderSession *session = (BlenderSession*)PyLong_AsVoidPtr(pysession);
PointerRNA objectptr;
@@ -172,9 +170,11 @@ static PyObject *bake_func(PyObject *self, PyObject *args)
RNA_id_pointer_create((ID*)PyLong_AsVoidPtr(pypixel_array), &bakepixelptr);
BL::BakePixel b_bake_pixel(bakepixelptr);
+ python_thread_state_save(&session->python_thread_state);
+
session->bake(b_object, pass_type, b_bake_pixel, num_pixels, depth, (float *)b_result);
- Py_END_ALLOW_THREADS
+ python_thread_state_restore(&session->python_thread_state);
Py_RETURN_NONE;
}