From f7635dd9207587ecb51370172ac20016fa30c1dc Mon Sep 17 00:00:00 2001 From: Fernando Nasser Date: Thu, 10 May 2001 16:57:01 +0000 Subject: [PATCH] 2001-05-10 Fernando Nasser * varobj.c (c_number_of_children): Fix memory leak. Delete unwanted old variables, not just unregister them. --- gdb/ChangeLog | 5 +++++ gdb/varobj.c | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 52287b459c4..f710253071b 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,8 @@ +2001-05-10 Fernando Nasser + + * varobj.c (c_number_of_children): Fix memory leak. Delete unwanted old + variables, not just unregister them. + 2001-05-10 Fernando Nasser * varobj.c (c_number_of_children): Check for target type of void*, diff --git a/gdb/varobj.c b/gdb/varobj.c index c61c313f088..c62aecffd65 100644 --- a/gdb/varobj.c +++ b/gdb/varobj.c @@ -1639,7 +1639,7 @@ value_of_root (struct varobj **var_handle, int *type_changed) { tmp_var->obj_name = savestring (var->obj_name, strlen (var->obj_name)); - uninstall_variable (var); + varobj_delete (var, NULL, 0); } else { -- 2.30.2