[Xorp-cvs] XORP cvs commit: xorp/libproto

Bruce Simpson bms at icir.org
Tue Apr 22 05:49:49 PDT 2008


CVSROOT:	/usr/local/www/data/cvs
Module name:	xorp
Changes by:	bms at chum.icir.org	2008-04-22 12:49:49 UTC

XORP CVS repository


Modified files:
	libproto      spt.hh test_spt.cc 

Log message:
	Fix memory leakage in the Spt meta-class.
	
	 * Add an Spt<A>::clear() method.
	   The _nodes container is repeatedly walked until emptied. Whilst using
	   a depth first search may be quicker, Spt has no notion of Node's degree.
	
	 * Add an explicit destructor Spt<A>::~Spt which invokes this method.
	   The data members are not PoD, they have special semantics, see next.
	
	 * In Spt<A>::garbage_collect(), use a reference to the NodeRef, which
	   defeats the ref_ptr reference count. We are, after all, garbage
	   collecting the Node, so we do NOT want a dangling reference.
	
	The NodeRefs are candidates for Boost++ shared_ptr and weak_ptr.
	
	Obtained from:  XORP/OLSR
	Verified with:  valgrind
	Sponsored by:   CenGen, Inc.

Revision  Changes                               Path
1.20      +51 -4;  commitid: e4a8480ddede41a7;  xorp/libproto/spt.hh
1.18      +9 -8;  commitid: e4a8480ddede41a7;   xorp/libproto/test_spt.cc



More information about the Xorp-cvs mailing list