aboutsummaryrefslogtreecommitdiff
path: root/scripts/Python/python-wrapper.swig
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/Python/python-wrapper.swig')
-rw-r--r--scripts/Python/python-wrapper.swig3
1 files changed, 2 insertions, 1 deletions
diff --git a/scripts/Python/python-wrapper.swig b/scripts/Python/python-wrapper.swig
index a92102e32838..96b8dda80f82 100644
--- a/scripts/Python/python-wrapper.swig
+++ b/scripts/Python/python-wrapper.swig
@@ -929,7 +929,8 @@ void LLDBSwigPythonCallPythonLogOutputCallback(const char *str, void *baton);
void LLDBSwigPythonCallPythonLogOutputCallback(const char *str, void *baton) {
if (baton != Py_None) {
SWIG_PYTHON_THREAD_BEGIN_BLOCK;
- PyObject_CallFunction(reinterpret_cast<PyObject*>(baton), const_cast<char*>("s"), str);
+ PyObject *result = PyObject_CallFunction(reinterpret_cast<PyObject*>(baton), const_cast<char*>("s"), str);
+ Py_XDECREF(result);
SWIG_PYTHON_THREAD_END_BLOCK;
}
}