forked from Imagelibrary/binutils-gdb
Use gdbpy_ref in gdbpy_inferiors
This changes gdbpy_inferiors to use gdbpy_ref. 2017-01-10 Tom Tromey <tom@tromey.com> * python/py-inferior.c (gdbpy_inferiors): Use gdbpy_ref.
This commit is contained in:
@@ -1,3 +1,7 @@
|
|||||||
|
2017-01-10 Tom Tromey <tom@tromey.com>
|
||||||
|
|
||||||
|
* python/py-inferior.c (gdbpy_inferiors): Use gdbpy_ref.
|
||||||
|
|
||||||
2017-01-10 Tom Tromey <tom@tromey.com>
|
2017-01-10 Tom Tromey <tom@tromey.com>
|
||||||
|
|
||||||
* python/py-function.c (convert_values_to_python, fnpy_init): Use
|
* python/py-function.c (convert_values_to_python, fnpy_init): Use
|
||||||
|
|||||||
@@ -477,22 +477,14 @@ build_inferior_list (struct inferior *inf, void *arg)
|
|||||||
PyObject *
|
PyObject *
|
||||||
gdbpy_inferiors (PyObject *unused, PyObject *unused2)
|
gdbpy_inferiors (PyObject *unused, PyObject *unused2)
|
||||||
{
|
{
|
||||||
PyObject *list, *tuple;
|
gdbpy_ref list (PyList_New (0));
|
||||||
|
if (list == NULL)
|
||||||
list = PyList_New (0);
|
|
||||||
if (!list)
|
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
if (iterate_over_inferiors (build_inferior_list, list))
|
if (iterate_over_inferiors (build_inferior_list, list.get ()))
|
||||||
{
|
return NULL;
|
||||||
Py_DECREF (list);
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
tuple = PyList_AsTuple (list);
|
return PyList_AsTuple (list.get ());
|
||||||
Py_DECREF (list);
|
|
||||||
|
|
||||||
return tuple;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Membuf and memory manipulation. */
|
/* Membuf and memory manipulation. */
|
||||||
|
|||||||
Reference in New Issue
Block a user