diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 0e17d7c39d..0dfc96ade1 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,15 @@ +2019-11-18 Philippe Waroquiers + + * python/py-block.c (blpy_dealloc): Call tp_free. + (blpy_block_syms_dealloc): Likewise. + * python/py-finishbreakpoint.c (bpfinishpy_dealloc): Likewise. + * python/py-inferior.c (infpy_dealloc): Likewise. + * python/py-lazy-string.c (stpy_dealloc): Likewise. + * python/py-linetable.c (ltpy_iterator_dealloc): Likewise. + * python/py-symbol.c (sympy_dealloc): Likewise. + * python/py-symtab.c (stpy_dealloc): Likewise. + * python/py-type.c (typy_iterator_dealloc): Likewise. + 2019-11-18 Christian Biesinger * symtab.h (struct symbol) : Initialize explicitly in the diff --git a/gdb/python/py-block.c b/gdb/python/py-block.c index 4dc47ff169..54c3be9b1a 100644 --- a/gdb/python/py-block.c +++ b/gdb/python/py-block.c @@ -276,6 +276,7 @@ blpy_dealloc (PyObject *obj) if (block->next) block->next->prev = block->prev; block->block = NULL; + Py_TYPE (obj)->tp_free (obj); } /* Given a block, and a block_object that has previously been @@ -370,6 +371,7 @@ blpy_block_syms_dealloc (PyObject *obj) block_syms_iterator_object *iter_obj = (block_syms_iterator_object *) obj; Py_XDECREF (iter_obj->source); + Py_TYPE (obj)->tp_free (obj); } /* Implementation of gdb.Block.is_valid (self) -> Boolean. diff --git a/gdb/python/py-finishbreakpoint.c b/gdb/python/py-finishbreakpoint.c index 7f818213bd..fc20575aea 100644 --- a/gdb/python/py-finishbreakpoint.c +++ b/gdb/python/py-finishbreakpoint.c @@ -83,6 +83,7 @@ bpfinishpy_dealloc (PyObject *self) Py_XDECREF (self_bpfinish->function_value); Py_XDECREF (self_bpfinish->return_type); Py_XDECREF (self_bpfinish->return_value); + Py_TYPE (self)->tp_free (self); } /* Triggered when gdbpy_should_stop is about to execute the `stop' callback diff --git a/gdb/python/py-inferior.c b/gdb/python/py-inferior.c index 28882221a9..d475263df9 100644 --- a/gdb/python/py-inferior.c +++ b/gdb/python/py-inferior.c @@ -856,6 +856,7 @@ infpy_dealloc (PyObject *obj) return; set_inferior_data (inf, infpy_inf_data_key, NULL); + Py_TYPE (obj)->tp_free (obj); } /* Clear the INFERIOR pointer in an Inferior object and clear the diff --git a/gdb/python/py-lazy-string.c b/gdb/python/py-lazy-string.c index 87c6ceaf2a..74f14a94eb 100644 --- a/gdb/python/py-lazy-string.c +++ b/gdb/python/py-lazy-string.c @@ -156,6 +156,7 @@ stpy_dealloc (PyObject *self) lazy_string_object *self_string = (lazy_string_object *) self; xfree (self_string->encoding); + Py_TYPE (self)->tp_free (self); } /* Low level routine to create a object. diff --git a/gdb/python/py-linetable.c b/gdb/python/py-linetable.c index aa43d9e7c7..96a5d3515b 100644 --- a/gdb/python/py-linetable.c +++ b/gdb/python/py-linetable.c @@ -369,6 +369,7 @@ ltpy_iterator_dealloc (PyObject *obj) ltpy_iterator_object *iter_obj = (ltpy_iterator_object *) obj; Py_DECREF (iter_obj->source); + Py_TYPE (obj)->tp_free (obj); } /* Return a reference to the line table iterator. */ diff --git a/gdb/python/py-symbol.c b/gdb/python/py-symbol.c index 647c54b0a5..b112ce115f 100644 --- a/gdb/python/py-symbol.c +++ b/gdb/python/py-symbol.c @@ -357,6 +357,7 @@ sympy_dealloc (PyObject *obj) if (sym_obj->next) sym_obj->next->prev = sym_obj->prev; sym_obj->symbol = NULL; + Py_TYPE (obj)->tp_free (obj); } /* Implementation of diff --git a/gdb/python/py-symtab.c b/gdb/python/py-symtab.c index 15af300150..49c6a0ac54 100644 --- a/gdb/python/py-symtab.c +++ b/gdb/python/py-symtab.c @@ -253,6 +253,7 @@ stpy_dealloc (PyObject *obj) if (symtab->next) symtab->next->prev = symtab->prev; symtab->symtab = NULL; + Py_TYPE (obj)->tp_free (obj); } diff --git a/gdb/python/py-type.c b/gdb/python/py-type.c index a2fca97a32..e4350993dd 100644 --- a/gdb/python/py-type.c +++ b/gdb/python/py-type.c @@ -1325,6 +1325,7 @@ typy_iterator_dealloc (PyObject *obj) typy_iterator_object *iter_obj = (typy_iterator_object *) obj; Py_DECREF (iter_obj->source); + Py_TYPE (obj)->tp_free (obj); } /* Create a new Type referring to TYPE. */