implement Dispose properly throughout the network stack

This commit is contained in:
Mathieu Lacage committed 2007-05-02 23:08:41 +02:00
1 parent f09be37481
commit 4e7a215f6a
10 files changed
+90 -194

No files matched your search

+21 -6
View File
@@ -48,12 +48,10 @@ InternetNode::InternetNode()
InternetNode::~InternetNode ()
{
delete m_applicationList;
delete m_l3Demux;
delete m_ipv4L4Demux;
Dispose ();
}
void
void
InternetNode::SetName (std::string name)
{
m_name = name;
@@ -77,8 +75,25 @@ InternetNode::CreateTraceResolver (TraceContext const &context)
void InternetNode::Dispose()
{
m_l3Demux->Dispose ();
m_ipv4L4Demux->Dispose ();
if (m_l3Demux != 0)
{
m_l3Demux->Dispose ();
delete m_l3Demux;
m_l3Demux = 0;
}
if (m_ipv4L4Demux != 0)
{
m_ipv4L4Demux->Dispose ();
delete m_ipv4L4Demux;
m_ipv4L4Demux = 0;
}
if (m_applicationList != 0)
{
m_applicationList->Dispose ();
delete m_applicationList;
m_applicationList = 0;
}
// chain up.
Node::Dispose ();