aboutsummaryrefslogtreecommitdiff
path: root/gdb/python/py-event.c
diff options
context:
space:
mode:
authorTom Tromey <tromey@redhat.com>2013-05-20 20:23:19 +0000
committerTom Tromey <tromey@redhat.com>2013-05-20 20:23:19 +0000
commitc127ec5867aa79e3dc9818b7203d84699a3a3ab7 (patch)
tree3153b8b3c16373e9a057f74e07350fafafde337b /gdb/python/py-event.c
parentba327838bac4a3a536fabaae0d151ff24f359495 (diff)
downloadgdb-c127ec5867aa79e3dc9818b7203d84699a3a3ab7.zip
gdb-c127ec5867aa79e3dc9818b7203d84699a3a3ab7.tar.gz
gdb-c127ec5867aa79e3dc9818b7203d84699a3a3ab7.tar.bz2
* python/py-event.c (evpy_emit_event): Decref the
result of PyObject_CallFunctionObjArgs.
Diffstat (limited to 'gdb/python/py-event.c')
-rw-r--r--gdb/python/py-event.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/gdb/python/py-event.c b/gdb/python/py-event.c
index 2c18e2f..afd07fe 100644
--- a/gdb/python/py-event.c
+++ b/gdb/python/py-event.c
@@ -111,16 +111,23 @@ evpy_emit_event (PyObject *event,
for (i = 0; i < PyList_Size (callback_list_copy); i++)
{
PyObject *func = PyList_GetItem (callback_list_copy, i);
+ PyObject *func_result;
if (func == NULL)
goto fail;
- if (!PyObject_CallFunctionObjArgs (func, event, NULL))
+ func_result = PyObject_CallFunctionObjArgs (func, event, NULL);
+
+ if (func_result == NULL)
{
/* Print the trace here, but keep going -- we want to try to
call all of the callbacks even if one is broken. */
gdbpy_print_stack ();
}
+ else
+ {
+ Py_DECREF (func_result);
+ }
}
Py_XDECREF (callback_list_copy);