diff options
Diffstat (limited to 'gdb/python/py-newobjfileevent.c')
-rw-r--r-- | gdb/python/py-newobjfileevent.c | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/gdb/python/py-newobjfileevent.c b/gdb/python/py-newobjfileevent.c index a9341a3..aa31fb4 100644 --- a/gdb/python/py-newobjfileevent.c +++ b/gdb/python/py-newobjfileevent.c @@ -66,12 +66,10 @@ create_clear_objfiles_event_object (void) if (objfile_event == NULL) return NULL; - /* Note that pspace_to_pspace_object returns a borrowed reference, - so we don't need a decref here. */ - PyObject *py_progspace = pspace_to_pspace_object (current_program_space); - if (!py_progspace || evpy_add_attribute (objfile_event.get (), - "progspace", - py_progspace) < 0) + gdbpy_ref<> py_progspace = pspace_to_pspace_object (current_program_space); + if (py_progspace == NULL || evpy_add_attribute (objfile_event.get (), + "progspace", + py_progspace.get ()) < 0) return NULL; return objfile_event; |