Simplify. There is no need for a SAFE_DELETE since attribute and children data structures are clear()ed.

This commit is contained in:
Steve Checkoway
2007-02-04 13:23:24 +00:00
parent eebc1e9f3c
commit 424f04219b
2 changed files with 3 additions and 8 deletions
+2 -7
View File
@@ -35,11 +35,6 @@ XNode::XNode( const XNode &cpy ):
this->AppendChild( new XNode(*c) ); this->AppendChild( new XNode(*c) );
} }
XNode::~XNode()
{
Free();
}
void XNode::Clear() void XNode::Clear()
{ {
Free(); Free();
@@ -49,9 +44,9 @@ void XNode::Clear()
void XNode::Free() void XNode::Free()
{ {
FOREACH_Child( this, p ) FOREACH_Child( this, p )
SAFE_DELETE( p ); delete p;
FOREACH_Attr( this, pAttr ) FOREACH_Attr( this, pAttr )
SAFE_DELETE( pAttr->second ); delete pAttr->second;
m_childs.clear(); m_childs.clear();
m_attrs.clear(); m_attrs.clear();
+1 -1
View File
@@ -129,7 +129,7 @@ public:
XNode(); XNode();
explicit XNode( const RString &sName ); explicit XNode( const RString &sName );
XNode( const XNode &cpy ); XNode( const XNode &cpy );
~XNode(); ~XNode() { Free(); }
void Clear(); void Clear();