+2013-05-20 Tom Tromey <tromey@redhat.com>
+
+ * python/python.c (gdbpy_run_events): Decref the result
+ of PyObject_CallObject.
+
2013-05-20 Tom Tromey <tromey@redhat.com>
* python/py-symtab.c (set_sal): Use
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;
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);
}