Re: [PATCH 1/4] Change pspace_to_pspace_object to return a new reference

Simon Marchi
2018-09-16T00:57:58Z

On 2018-09-13 1:30 a.m., Tom Tromey wrote:
> diff --git a/gdb/python/py-objfile.c b/gdb/python/py-objfile.c
> index c2b40ff5352..8fd160c7bf8 100644
> --- a/gdb/python/py-objfile.c
> +++ b/gdb/python/py-objfile.c
> @@ -167,10 +167,8 @@ objfpy_get_progspace (PyObject *self, void *closure)
>
> if (obj->objfile)
> {
> - PyObject *pspace = pspace_to_pspace_object (obj->objfile->pspace);
> -
> - Py_XINCREF (pspace);
> - return pspace;
> + gdbpy_ref<> pspace = pspace_to_pspace_object (obj->objfile->pspace);
> + return pspace.get ();
> }

Can you double check this, shouldn't it be .release()? Otherwise, LGTM.

Simon