This is the mail archive of the insight@sources.redhat.com mailing list for the Insight project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

[patch] Fix memory leak.


I have checked this in.

	* varobj.c (c_number_of_children): Fix memory leak. Delete unwanted
	old variables, not just unregister them.


Index: varobj.c
===================================================================
RCS file: /cvs/src/src/gdb/varobj.c,v
retrieving revision 1.18
diff -c -p -r1.18 varobj.c
*** varobj.c	2001/05/10 16:44:56	1.18
--- varobj.c	2001/05/10 16:45:36
*************** value_of_root (struct varobj **var_handl
*** 1639,1645 ****
  	    {
  	      tmp_var->obj_name = 
  		savestring (var->obj_name, strlen (var->obj_name));
! 	      uninstall_variable (var);
  	    }
  	  else
  	    {
--- 1639,1645 ----
  	    {
  	      tmp_var->obj_name = 
  		savestring (var->obj_name, strlen (var->obj_name));
! 	      varobj_delete (var, NULL, 0);
  	    }
  	  else
  	    {
                                                                               


-- 
Fernando Nasser
Red Hat Canada Ltd.                     E-Mail:  fnasser@redhat.com
2323 Yonge Street, Suite #300
Toronto, Ontario   M4P 2C9


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]