From 35c61a1dd5462ceab42618c48c9a60238245761b Mon Sep 17 00:00:00 2001 From: Tom Tromey Date: Fri, 8 Sep 2017 14:26:43 -0600 Subject: Small event ownership clean up in Python layer It seems cleaner to me for functions like create_thread_event_object, which pass object ownership to their callers, to directly return a gdb_ref<>. This way the ownership transfer is part of the API. This patch makes this change. ChangeLog 2017-09-11 Tom Tromey * python/py-threadevent.c (create_thread_event_object): Return gdbpy_ref. * python/py-stopevent.h (create_stop_event_object) (create_breakpoint_event_object, create_signal_event_object): Update. * python/py-stopevent.c (create_stop_event_object): Return gdbpy_ref. (emit_stop_event): Update. * python/py-signalevent.c (create_signal_event_object): Return gdbpy_ref. * python/py-infevents.c (create_inferior_call_event_object): Update. * python/py-event.h (create_event_object) (create_thread_event_object): Update. * python/py-event.c (create_event_object): Return gdbpy_ref. * python/py-continueevent.c: Return gdbpy_ref. * python/py-bpevent.c (create_breakpoint_event_object): Return gdbpy_ref. --- gdb/python/py-infevents.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'gdb/python/py-infevents.c') diff --git a/gdb/python/py-infevents.c b/gdb/python/py-infevents.c index 6e3c8c8..8a63b79 100644 --- a/gdb/python/py-infevents.c +++ b/gdb/python/py-infevents.c @@ -43,10 +43,10 @@ create_inferior_call_event_object (inferior_call_kind flag, ptid_t ptid, switch (flag) { case INFERIOR_CALL_PRE: - event.reset (create_event_object (&inferior_call_pre_event_object_type)); + event = create_event_object (&inferior_call_pre_event_object_type); break; case INFERIOR_CALL_POST: - event.reset (create_event_object (&inferior_call_post_event_object_type)); + event = create_event_object (&inferior_call_post_event_object_type); break; default: gdb_assert_not_reached ("invalid inferior_call_kind"); -- cgit v1.1