Improve reference counting in py-type.c
authorTom Tromey <tom@tromey.com>
Thu, 27 Dec 2018 19:08:09 +0000 (12:08 -0700)
committerTom Tromey <tom@tromey.com>
Thu, 3 Jan 2019 21:49:19 +0000 (14:49 -0700)
commit1b20edf043c62759a4c78e40b03846e9bafd584c
tree9a4c266ac7be0a336d76deda2a03afbbc06cea9c
parentea41325b7d134e91648e340d8297e8f6ee5fe26a
Improve reference counting in py-type.c

This improves the reference counting in py-type.c by using gdbpy_ref
and gdbpy_ref::new_reference in more places.

gdb/ChangeLog
2019-01-03  Tom Tromey  <tom@tromey.com>

* python/py-type.c (convert_field): Use new_reference.  Return
gdbpy_ref.
(make_fielditem): Return gdbpy_ref.
(typy_fields): Update.
(typy_getitem): Update.
(field_name): Return gdbpy_ref.  Use new_reference.
(typy_iterator_iternext): Update.
gdb/ChangeLog
gdb/python/py-type.c