From: Tom Tromey Date: Mon, 20 May 2013 20:32:56 +0000 (+0000) Subject: * python/python.c (gdbpy_run_events): Decref the result X-Git-Url: http://drtracing.org/?a=commitdiff_plain;h=02146ba51f96bbda66cef7da9cc6efa863a50328;p=deliverable%2Fbinutils-gdb.git * python/python.c (gdbpy_run_events): Decref the result of PyObject_CallObject. --- diff --git a/gdb/ChangeLog b/gdb/ChangeLog index db245ea899..4dea044c9d 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,8 @@ +2013-05-20 Tom Tromey + + * python/python.c (gdbpy_run_events): Decref the result + of PyObject_CallObject. + 2013-05-20 Tom Tromey * python/py-symtab.c (set_sal): Use diff --git a/gdb/python/python.c b/gdb/python/python.c index e8a70da8f2..605efc04ae 100644 --- a/gdb/python/python.c +++ b/gdb/python/python.c @@ -819,6 +819,8 @@ gdbpy_run_events (struct serial *scb, void *context) while (gdbpy_event_list) { + PyObject *call_result; + /* Dispatching the event might push a new element onto the event loop, so we update here "atomically enough". */ struct gdbpy_event *item = gdbpy_event_list; @@ -827,9 +829,11 @@ gdbpy_run_events (struct serial *scb, void *context) gdbpy_event_list_end = &gdbpy_event_list; /* Ignore errors. */ - if (PyObject_CallObject (item->event, NULL) == NULL) + call_result = PyObject_CallObject (item->event, NULL); + if (call_result == NULL) PyErr_Clear (); + Py_XDECREF (call_result); Py_DECREF (item->event); xfree (item); }