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:
authorSebastián Barschkis <sebbas@sebbas.org>2020-01-22 13:17:34 +0300
committerSebastián Barschkis <sebbas@sebbas.org>2020-01-22 13:17:54 +0300
commitc4b5279bbca4db2ee88e0451fe6d41175e26719a (patch)
treef600af37ef896aba26ddc35414ac6016f8b3bdb6 /intern/mantaflow
parent908ed661ee056a6d7af560190898c3ed78112e47 (diff)
Fix T72894: Mantaflow: several crashes due to null pointers
Incorporated LazyDodo's suggestions from the task.
Diffstat (limited to 'intern/mantaflow')
-rw-r--r--intern/mantaflow/intern/MANTA_main.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/intern/mantaflow/intern/MANTA_main.cpp b/intern/mantaflow/intern/MANTA_main.cpp
index 79363126aff..a1851da711a 100644
--- a/intern/mantaflow/intern/MANTA_main.cpp
+++ b/intern/mantaflow/intern/MANTA_main.cpp
@@ -2057,7 +2057,10 @@ static char *pyObjectToString(PyObject *inputObject)
PyObject *encoded = PyUnicode_AsUTF8String(inputObject);
char *result = PyBytes_AsString(encoded);
- Py_DECREF(encoded);
+
+ /* Do not decref (i.e. Py_DECREF(encoded)) of string 'encoded' PyObject.
+ * Otherwise those objects will be invalidated too early (see T72894).
+ * Reference count of those Python objects will be decreased with 'del' in Python scripts. */
Py_DECREF(inputObject);
PyGILState_Release(gilstate);