diff options
Diffstat (limited to 'include/lldb/Interpreter/PythonDataObjects.h')
-rw-r--r-- | include/lldb/Interpreter/PythonDataObjects.h | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/include/lldb/Interpreter/PythonDataObjects.h b/include/lldb/Interpreter/PythonDataObjects.h index 63f1ad5..a1145b6 100644 --- a/include/lldb/Interpreter/PythonDataObjects.h +++ b/include/lldb/Interpreter/PythonDataObjects.h @@ -62,9 +62,11 @@ namespace lldb_private { { if (py_obj != m_py_obj) { - Py_XDECREF(m_py_obj); + if (Py_IsInitialized()) + Py_XDECREF(m_py_obj); m_py_obj = py_obj; - Py_XINCREF(m_py_obj); + if (Py_IsInitialized()) + Py_XINCREF(m_py_obj); } return true; } |