mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-08-06 06:45:56 +08:00
Use gdbpy_ref in instantiate_pretty_printer
This changes instantiate_pretty_printer to use gdbpy_ref, removing a call to Py_DECREF. gdb/ChangeLog 2020-12-11 Tom Tromey <tom@tromey.com> * varobj.c (instantiate_pretty_printer): Use gdbpy_ref.
This commit is contained in:
@ -1,3 +1,7 @@
|
||||
2020-12-11 Tom Tromey <tom@tromey.com>
|
||||
|
||||
* varobj.c (instantiate_pretty_printer): Use gdbpy_ref.
|
||||
|
||||
2020-12-11 Tom Tromey <tom@tromey.com>
|
||||
|
||||
* varobj.c (varobj_clear_saved_item): Remove.
|
||||
|
11
gdb/varobj.c
11
gdb/varobj.c
@ -459,16 +459,11 @@ varobj_delete (struct varobj *var, bool only_children)
|
||||
static PyObject *
|
||||
instantiate_pretty_printer (PyObject *constructor, struct value *value)
|
||||
{
|
||||
PyObject *val_obj = NULL;
|
||||
PyObject *printer;
|
||||
|
||||
val_obj = value_to_value_object (value);
|
||||
if (! val_obj)
|
||||
gdbpy_ref<> val_obj (value_to_value_object (value));
|
||||
if (val_obj == nullptr)
|
||||
return NULL;
|
||||
|
||||
printer = PyObject_CallFunctionObjArgs (constructor, val_obj, NULL);
|
||||
Py_DECREF (val_obj);
|
||||
return printer;
|
||||
return PyObject_CallFunctionObjArgs (constructor, val_obj.get (), NULL);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
Reference in New Issue
Block a user