From: Tom Tromey Date: Mon, 20 May 2013 20:27:44 +0000 (+0000) Subject: * python/py-finishbreakpoint.c (bpfinishpy_out_of_scope): X-Git-Tag: cygwin-1_7_19-release~158 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=1886886089ccce6186d63a155c9e84544d241789;p=thirdparty%2Fbinutils-gdb.git * python/py-finishbreakpoint.c (bpfinishpy_out_of_scope): Decref the reslut of PyObject_CallMethod. --- diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 5c4e29067a8..5103cbc5400 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,8 @@ +2013-05-20 Tom Tromey + + * python/py-finishbreakpoint.c (bpfinishpy_out_of_scope): + Decref the reslut of PyObject_CallMethod. + 2013-05-20 Tom Tromey * python/py-event.c (gdbpy_initialize_event_generic): Return diff --git a/gdb/python/py-finishbreakpoint.c b/gdb/python/py-finishbreakpoint.c index b52bd7ec5c0..f65e0265840 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);