diff options
author | Tom Tromey <tromey@redhat.com> | 2013-05-20 20:27:44 +0000 |
---|---|---|
committer | Tom Tromey <tromey@redhat.com> | 2013-05-20 20:27:44 +0000 |
commit | 1886886089ccce6186d63a155c9e84544d241789 (patch) | |
tree | c5b5c0838e70ddaf0773456e46e1d3037239ad83 | |
parent | 9f4ff0c296819bbe3abd4c3717cf8677c5a89310 (diff) | |
download | gdb-1886886089ccce6186d63a155c9e84544d241789.zip gdb-1886886089ccce6186d63a155c9e84544d241789.tar.gz gdb-1886886089ccce6186d63a155c9e84544d241789.tar.bz2 |
* python/py-finishbreakpoint.c (bpfinishpy_out_of_scope):
Decref the reslut of PyObject_CallMethod.
-rw-r--r-- | gdb/ChangeLog | 5 | ||||
-rw-r--r-- | gdb/python/py-finishbreakpoint.c | 8 |
2 files changed, 11 insertions, 2 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 5c4e290..5103cbc 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,5 +1,10 @@ 2013-05-20 Tom Tromey <tromey@redhat.com> + * python/py-finishbreakpoint.c (bpfinishpy_out_of_scope): + Decref the reslut of PyObject_CallMethod. + +2013-05-20 Tom Tromey <tromey@redhat.com> + * python/py-event.c (gdbpy_initialize_event_generic): Return early if PyType_Ready fails. diff --git a/gdb/python/py-finishbreakpoint.c b/gdb/python/py-finishbreakpoint.c index b52bd7e..f65e026 100644 --- a/gdb/python/py-finishbreakpoint.c +++ b/gdb/python/py-finishbreakpoint.c @@ -326,8 +326,12 @@ bpfinishpy_out_of_scope (struct finish_breakpoint_object *bpfinish_obj) if (bpfinish_obj->py_bp.bp->enable_state == bp_enabled && PyObject_HasAttrString (py_obj, outofscope_func)) { - if (!PyObject_CallMethod (py_obj, outofscope_func, NULL)) - gdbpy_print_stack (); + PyObject *meth_result; + + meth_result = PyObject_CallMethod (py_obj, outofscope_func, NULL); + if (meth_result == NULL) + gdbpy_print_stack (); + Py_XDECREF (meth_result); } delete_breakpoint (bpfinish_obj->py_bp.bp); |