From aa087ed34445408009dd5a7eb615e89194563189 Mon Sep 17 00:00:00 2001 From: Nicola Baldo Date: Wed, 30 Mar 2011 16:41:45 +0200 Subject: [PATCH] added more disposal stuff --- src/lte/model/lte-enb-net-device.cc | 21 ++++++++++++--------- src/lte/model/lte-enb-phy.cc | 1 + src/lte/model/lte-phy.cc | 9 ++++----- src/lte/model/lte-ue-net-device.cc | 13 +++++++------ 4 files changed, 24 insertions(+), 20 deletions(-) diff --git a/src/lte/model/lte-enb-net-device.cc b/src/lte/model/lte-enb-net-device.cc index 3437eab3a..1027a5ad8 100644 --- a/src/lte/model/lte-enb-net-device.cc +++ b/src/lte/model/lte-enb-net-device.cc @@ -58,7 +58,7 @@ TypeId LteEnbNetDevice::GetTypeId (void) .SetParent () .AddConstructor () .AddAttribute ("LteEnbRrc", - "The RRC associated to this EnbNetDevice.", + "The RRC associated to this EnbNetDevice", PointerValue (), MakePointerAccessor (&LteEnbNetDevice::m_rrc), MakePointerChecker ()) @@ -94,14 +94,17 @@ LteEnbNetDevice::DoDispose () { NS_LOG_FUNCTION (this); -// m_mac->Dispose (); -// m_mac = 0; -// -// m_rrc->Dispose (); -// m_rrc = 0; -// -// m_phy->Dispose (); -// m_phy = 0; + m_mac->Dispose (); + m_mac = 0; + + m_scheduler->Dispose (); + m_scheduler = 0; + + m_rrc->Dispose (); + m_rrc = 0; + + m_phy->Dispose (); + m_phy = 0; LteNetDevice::DoDispose (); } diff --git a/src/lte/model/lte-enb-phy.cc b/src/lte/model/lte-enb-phy.cc index 7a6fa41ee..618e787e5 100644 --- a/src/lte/model/lte-enb-phy.cc +++ b/src/lte/model/lte-enb-phy.cc @@ -124,6 +124,7 @@ void LteEnbPhy::DoDispose () { NS_LOG_FUNCTION (this); + m_ueAttached.clear (); LtePhy::DoDispose (); } diff --git a/src/lte/model/lte-phy.cc b/src/lte/model/lte-phy.cc index 3069b4ba3..40ba03d28 100644 --- a/src/lte/model/lte-phy.cc +++ b/src/lte/model/lte-phy.cc @@ -79,14 +79,13 @@ void LtePhy::DoDispose () { NS_LOG_FUNCTION (this); + m_packetBurstQueue.clear (); + m_controlMessagesQueue.clear (); + m_downlinkSpectrumPhy->Dispose (); m_downlinkSpectrumPhy = 0; + m_uplinkSpectrumPhy->Dispose (); m_uplinkSpectrumPhy = 0; m_netDevice = 0; - for (int i = 0; i < m_macChTtiDelay; i++) - { - m_packetBurstQueue.erase (m_packetBurstQueue.begin (), m_packetBurstQueue.end ()); - m_controlMessagesQueue.erase (m_controlMessagesQueue.begin (), m_controlMessagesQueue.end ()); - } Object::DoDispose (); } diff --git a/src/lte/model/lte-ue-net-device.cc b/src/lte/model/lte-ue-net-device.cc index aed4424c9..b6fedd23c 100644 --- a/src/lte/model/lte-ue-net-device.cc +++ b/src/lte/model/lte-ue-net-device.cc @@ -90,13 +90,14 @@ void LteUeNetDevice::DoDispose (void) { NS_LOG_FUNCTION (this); + m_targetEnb->Dispose (); m_targetEnb = 0; -// m_mac->Dispose (); -// m_mac = 0; -// m_rrc->Dispose (); -// m_rrc = 0; -// m_phy->Dispose (); -// m_phy = 0; + m_mac->Dispose (); + m_mac = 0; + m_rrc->Dispose (); + m_rrc = 0; + m_phy->Dispose (); + m_phy = 0; LteNetDevice::DoDispose (); }