spectrum: Change order of disposal for ThreeGppPropagationLossModel

This commit is contained in:
Gabriel Ferreira
2025-01-13 20:39:49 +01:00
parent 4b9e0c68e3
commit cd67ed9814
2 changed files with 9 additions and 1 deletions

View File

@@ -33,9 +33,18 @@ void
SpectrumChannel::DoDispose()
{
NS_LOG_FUNCTION(this);
// Any propagation model that holds a pointer
// back to the spectrum channel should not call Dispose()
// of its channel pointer, or else a loop may occur.
m_propagationLoss = nullptr;
m_propagationDelay = nullptr;
m_spectrumPropagationLoss = nullptr;
if (m_phasedArraySpectrumPropagationLoss)
{
m_phasedArraySpectrumPropagationLoss->Dispose();
}
m_phasedArraySpectrumPropagationLoss = nullptr;
}
TypeId

View File

@@ -44,7 +44,6 @@ void
ThreeGppSpectrumPropagationLossModel::DoDispose()
{
m_longTermMap.clear();
m_channelModel->Dispose();
m_channelModel = nullptr;
}