From 6ff4af8e182333740a58176a3e9cbc84f6828216 Mon Sep 17 00:00:00 2001 From: Pavel Labath Date: Wed, 19 Jan 2022 11:59:19 +0100 Subject: [lldb] Fix D114722 for python<=3.6 _Py_IsFinalizing was called _Py_Finalizing back then (and it was a variable instead of a function). --- .../Plugins/ScriptInterpreter/Python/PythonDataObjects.h | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) (limited to 'lldb/source/Plugins/ScriptInterpreter/Python/PythonDataObjects.h') 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) -- cgit v1.1