From bad00337b4055919fda349f2487dfd67af022b9a Mon Sep 17 00:00:00 2001 From: ShouheiNishi <96609867+ShouheiNishi@users.noreply.github.com> Date: Tue, 22 Mar 2022 16:30:06 +0900 Subject: [PATCH] Fix that some UEs are not removed in RemoveAllUeInRan (#64) --- context/amf_ran.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/context/amf_ran.go b/context/amf_ran.go index 6d043c59..bbf8633b 100644 --- a/context/amf_ran.go +++ b/context/amf_ran.go @@ -69,7 +69,9 @@ func (ran *AmfRan) NewRanUe(ranUeNgapID int64) (*RanUe, error) { } func (ran *AmfRan) RemoveAllUeInRan() { - for _, ranUe := range ran.RanUeList { + saveRanUeList := make([]*RanUe, len(ran.RanUeList)) + copy(saveRanUeList, ran.RanUeList) + for _, ranUe := range saveRanUeList { if err := ranUe.Remove(); err != nil { logger.ContextLog.Errorf("Remove RanUe error: %v", err) }