diff options
| author | Pavel Labath <pavel@labath.sk> | 2022-01-19 11:59:19 +0100 |
|---|---|---|
| committer | Pavel Labath <pavel@labath.sk> | 2022-01-19 12:49:46 +0100 |
| commit | 6ff4af8e182333740a58176a3e9cbc84f6828216 (patch) | |
| tree | 07940d4f8a814627aed9a2aab2b39bd6e7364b1a /lldb/source/Plugins/ScriptInterpreter/Python/PythonDataObjects.h | |
| parent | 6eb8fc924485facd911b49370f53ab93728b2935 (diff) | |
| download | llvm-6ff4af8e182333740a58176a3e9cbc84f6828216.zip llvm-6ff4af8e182333740a58176a3e9cbc84f6828216.tar.gz llvm-6ff4af8e182333740a58176a3e9cbc84f6828216.tar.bz2 | |
[lldb] Fix D114722 for python<=3.6
_Py_IsFinalizing was called _Py_Finalizing back then (and it was a
variable instead of a function).
Diffstat (limited to 'lldb/source/Plugins/ScriptInterpreter/Python/PythonDataObjects.h')
| -rw-r--r-- | lldb/source/Plugins/ScriptInterpreter/Python/PythonDataObjects.h | 14 |
1 files changed, 1 insertions, 13 deletions
diff --git a/lldb/source/Plugins/ScriptInterpreter/Python/PythonDataObjects.h b/lldb/source/Plugins/ScriptInterpreter/Python/PythonDataObjects.h index 7dd8a74..2094f0b 100644 --- a/lldb/source/Plugins/ScriptInterpreter/Python/PythonDataObjects.h +++ b/lldb/source/Plugins/ScriptInterpreter/Python/PythonDataObjects.h @@ -239,19 +239,7 @@ public: ~PythonObject() { Reset(); } - void Reset() { - if (m_py_obj && Py_IsInitialized()) { - if (_Py_IsFinalizing()) { - // Leak m_py_obj rather than crashing the process. - // https://docs.python.org/3/c-api/init.html#c.PyGILState_Ensure - } else { - PyGILState_STATE state = PyGILState_Ensure(); - Py_DECREF(m_py_obj); - PyGILState_Release(state); - } - } - m_py_obj = nullptr; - } + void Reset(); void Dump() const { if (m_py_obj) |
