This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [RFA 16/20] Use gdbpy_enter in gdbpy_get_matching_xmethod_workers
On 11/10/2016 10:19 PM, Tom Tromey wrote:
> @@ -221,26 +210,21 @@ gdbpy_get_matching_xmethod_workers
> py_progspace = pspace_to_pspace_object (current_program_space);
> if (py_progspace != NULL)
> {
> - PyObject *temp = py_xmethod_matcher_list;
> - PyObject *pspace_matchers = pspy_get_xmethods (py_progspace, NULL);
> + gdbpy_reference pspace_matchers (pspy_get_xmethods (py_progspace, NULL));
>
> - py_xmethod_matcher_list = PySequence_Concat (temp, pspace_matchers);
> - Py_DECREF (temp);
> - Py_DECREF (pspace_matchers);
I'm a little confused here. Don't we still need to account for
these two Py_DECREFs?
> - if (py_xmethod_matcher_list == NULL)
> + gdbpy_reference temp (PySequence_Concat (py_xmethod_matcher_list.get (),
> + pspace_matchers.get ()));
> + if (temp == NULL)
> {
> gdbpy_print_stack ();
> - do_cleanups (cleanups);
> -
> return EXT_LANG_RC_ERROR;
--
Thanks,
Pedro Alves