diff options
author | Tom Tromey <tromey@redhat.com> | 2013-05-20 20:32:56 +0000 |
---|---|---|
committer | Tom Tromey <tromey@redhat.com> | 2013-05-20 20:32:56 +0000 |
commit | 636305372b3cdc5b60127ed7ea546bdbee217226 (patch) | |
tree | 12a54efc6cc3b946fe9d02ee338b7b4c5414b9f3 /gdb/python | |
parent | 2e687216be4e6f289cb8083e18f1ccfb3bde90cd (diff) | |
download | gdb-636305372b3cdc5b60127ed7ea546bdbee217226.tar.gz |
* python/python.c (gdbpy_run_events): Decref the result
of PyObject_CallObject.
Diffstat (limited to 'gdb/python')
-rw-r--r-- | gdb/python/python.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/gdb/python/python.c b/gdb/python/python.c index e8a70da8f28..605efc04ae9 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); } |