Skip to content

Commit

Permalink
spectrum: Change order of disposal for ThreeGppPropagationLossModel
Browse files Browse the repository at this point in the history
  • Loading branch information
Gabrielcarvfer committed Jan 13, 2025
1 parent 4b9e0c6 commit cd67ed9
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
9 changes: 9 additions & 0 deletions src/spectrum/model/spectrum-channel.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ void
ThreeGppSpectrumPropagationLossModel::DoDispose()
{
m_longTermMap.clear();
m_channelModel->Dispose();
m_channelModel = nullptr;
}

Expand Down

0 comments on commit cd67ed9

Please sign in to comment.