Fix a python object leak in SWIG glue.
PyObject_CallFunction returns a PyObject which needs to be decref'ed when it is no longer needed. Patch by David Luyer Differential Revision: https://reviews.llvm.org/D33740 llvm-svn: 305873
This commit is contained in:
parent
ca48d369ba
commit
10a601adb2
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue