aboutsummaryrefslogtreecommitdiff
path: root/gdb/python/py-progspace.c
diff options
context:
space:
mode:
Diffstat (limited to 'gdb/python/py-progspace.c')
-rw-r--r--gdb/python/py-progspace.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/gdb/python/py-progspace.c b/gdb/python/py-progspace.c
index 3c46847..1e16b84 100644
--- a/gdb/python/py-progspace.c
+++ b/gdb/python/py-progspace.c
@@ -344,9 +344,10 @@ pspy_get_objfiles (PyObject *self_, PyObject *args)
ALL_PSPACE_OBJFILES (self->pspace, objf)
{
- PyObject *item = objfile_to_objfile_object (objf);
+ gdbpy_ref<> item = objfile_to_objfile_object (objf);
- if (!item || PyList_Append (list.get (), item) == -1)
+ if (item == nullptr
+ || PyList_Append (list.get (), item.get ()) == -1)
return NULL;
}
}