From db1337cc8300bb44f8ccf9dced3e122b6e50b4c9 Mon Sep 17 00:00:00 2001 From: Tom Tromey Date: Wed, 12 Sep 2018 23:15:48 -0600 Subject: Change thread_to_thread_object to return a new reference This changes thread_to_thread_object to return a new reference and fixes up all the callers. gdb/ChangeLog 2018-09-16 Tom Tromey * python/python-internal.h (thread_to_thread_object): Change return type. * python/py-inferior.c (thread_to_thread_object): Return a new reference. (infpy_thread_from_thread_handle): Update. * python/py-infthread.c (gdbpy_selected_thread): Update. * python/py-stopevent.c (create_stop_event_object): Update. * python/py-threadevent.c (py_get_event_thread): Return a new reference. (py_get_event_thread): Update. * python/py-event.h (py_get_event_thread): Change return type. * python/py-continueevent.c (create_continue_event_object): Update. --- gdb/python/py-threadevent.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'gdb/python/py-threadevent.c') diff --git a/gdb/python/py-threadevent.c b/gdb/python/py-threadevent.c index 4f822b4..13af1c8 100644 --- a/gdb/python/py-threadevent.c +++ b/gdb/python/py-threadevent.c @@ -22,19 +22,19 @@ /* See py-event.h. */ -PyObject * +gdbpy_ref<> py_get_event_thread (ptid_t ptid) { - PyObject *pythread = nullptr; + gdbpy_ref<> pythread; if (non_stop) { thread_info *thread = find_thread_ptid (ptid); if (thread != nullptr) - pythread = (PyObject *) thread_to_thread_object (thread); + pythread = thread_to_thread_object (thread); } else - pythread = Py_None; + pythread = gdbpy_ref<>::new_reference (Py_None); if (pythread == nullptr) { -- cgit v1.1