* python/py-event.c (evpy_emit_event): Decref the
result of PyObject_CallFunctionObjArgs.
This commit is contained in:
parent
ba327838ba
commit
c127ec5867
2 changed files with 13 additions and 1 deletions
|
@ -1,3 +1,8 @@
|
||||||
|
2013-05-20 Tom Tromey <tromey@redhat.com>
|
||||||
|
|
||||||
|
* python/py-event.c (evpy_emit_event): Decref the
|
||||||
|
result of PyObject_CallFunctionObjArgs.
|
||||||
|
|
||||||
2013-05-20 Tom Tromey <tromey@redhat.com>
|
2013-05-20 Tom Tromey <tromey@redhat.com>
|
||||||
|
|
||||||
* python/py-cmd.c (cmdpy_completer): Use iterator protocol.
|
* python/py-cmd.c (cmdpy_completer): Use iterator protocol.
|
||||||
|
|
|
@ -111,16 +111,23 @@ evpy_emit_event (PyObject *event,
|
||||||
for (i = 0; i < PyList_Size (callback_list_copy); i++)
|
for (i = 0; i < PyList_Size (callback_list_copy); i++)
|
||||||
{
|
{
|
||||||
PyObject *func = PyList_GetItem (callback_list_copy, i);
|
PyObject *func = PyList_GetItem (callback_list_copy, i);
|
||||||
|
PyObject *func_result;
|
||||||
|
|
||||||
if (func == NULL)
|
if (func == NULL)
|
||||||
goto fail;
|
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
|
/* Print the trace here, but keep going -- we want to try to
|
||||||
call all of the callbacks even if one is broken. */
|
call all of the callbacks even if one is broken. */
|
||||||
gdbpy_print_stack ();
|
gdbpy_print_stack ();
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Py_DECREF (func_result);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Py_XDECREF (callback_list_copy);
|
Py_XDECREF (callback_list_copy);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue