]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
* python/py-finishbreakpoint.c (bpfinishpy_out_of_scope):
authorTom Tromey <tromey@redhat.com>
Mon, 20 May 2013 20:27:44 +0000 (20:27 +0000)
committerTom Tromey <tromey@redhat.com>
Mon, 20 May 2013 20:27:44 +0000 (20:27 +0000)
Decref the reslut of PyObject_CallMethod.

gdb/ChangeLog
gdb/python/py-finishbreakpoint.c

index 5c4e29067a8bff417734cb3d0afb5dafb0ce4ff3..5103cbc540059c32dec93a79fe3032d44e6d98f7 100644 (file)
@@ -1,3 +1,8 @@
+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
index b52bd7ec5c01065e34d7323723e7cb8bbdc8dfaa..f65e02658402cfef9c2abb89e951adae68def08c 100644 (file)
@@ -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);