* python/python.c (gdbpy_run_events): Decref the result
authorTom Tromey <tromey@redhat.com>
Mon, 20 May 2013 20:32:56 +0000 (20:32 +0000)
committerTom Tromey <tromey@redhat.com>
Mon, 20 May 2013 20:32:56 +0000 (20:32 +0000)
of PyObject_CallObject.

gdb/ChangeLog
gdb/python/python.c

index db245ea899e98ce9b0a6faf56f3e0779c9e19d97..4dea044c9d564cb4e20811b4f523180115f8f831 100644 (file)
@@ -1,3 +1,8 @@
+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
index e8a70da8f284bf3dbd632558e256c1ecd1b22d5f..605efc04ae9c7b5e3136d0bbc7622d2f0391616c 100644 (file)
@@ -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);
     }
This page took 0.030132 seconds and 4 git commands to generate.