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:
authorSergey Sharybin <sergey.vfx@gmail.com>2016-10-20 14:32:52 +0300
committerSergey Sharybin <sergey.vfx@gmail.com>2016-10-20 14:33:47 +0300
commit32c2cba4ef1c940dab559cdc47b886c60cc9f2e1 (patch)
treeb0b8358cbcff95c7eb4b5099c4e41df9e2244e69 /source/blender/python
parent2cd6a89d07e031901291ab95b9a5d6cdeb372bbe (diff)
Fix T49797: Exception from scene update handler might leak external engine descriptors
This was causing memory leaks in Cycles. Some more detailed information in the comment in the code. Seems to be safe and nice enough for 2.78a.
Diffstat (limited to 'source/blender/python')
-rw-r--r--source/blender/python/intern/bpy_app_handlers.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/source/blender/python/intern/bpy_app_handlers.c b/source/blender/python/intern/bpy_app_handlers.c
index 6a8b0b065c2..1cc2d6f1307 100644
--- a/source/blender/python/intern/bpy_app_handlers.c
+++ b/source/blender/python/intern/bpy_app_handlers.c
@@ -317,7 +317,13 @@ void bpy_app_generic_callback(struct Main *UNUSED(main), struct ID *id, void *ar
func = PyList_GET_ITEM(cb_list, pos);
ret = PyObject_Call(func, args, NULL);
if (ret == NULL) {
- PyErr_Print();
+ /* Don't set last system variables because they might cause some
+ * dangling pointers to external render engines (when exception
+ * happens during rendering) which will break logic of render pipeline
+ * which expects to be the only user of render engine when rendering
+ * is finished.
+ */
+ PyErr_PrintEx(0);
PyErr_Clear();
}
else {