diff options
-rw-r--r-- | intern/mantaflow/intern/MANTA_main.cpp | 5 |
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); |