aboutsummaryrefslogtreecommitdiff
path: root/include/lldb/Interpreter/PythonDataObjects.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/lldb/Interpreter/PythonDataObjects.h')
-rw-r--r--include/lldb/Interpreter/PythonDataObjects.h6
1 files changed, 4 insertions, 2 deletions
diff --git a/include/lldb/Interpreter/PythonDataObjects.h b/include/lldb/Interpreter/PythonDataObjects.h
index 63f1ad5f67bf..a1145b6f33d9 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;
}