[VOL-4548] openonuAdapterGo - memory leak seen in long term tests
Change-Id: Ie3eb2048cebf8bf8b2f2a99ccd927d462000223a
diff --git a/internal/pkg/avcfg/omci_ani_config.go b/internal/pkg/avcfg/omci_ani_config.go
index 34ed185..cc023ba 100755
--- a/internal/pkg/avcfg/omci_ani_config.go
+++ b/internal/pkg/avcfg/omci_ani_config.go
@@ -1817,3 +1817,11 @@
oFsm.mutexChanSet.RUnlock()
return flagValue
}
+
+// PrepareForGarbageCollection - remove references to prepare for garbage collection
+func (oFsm *UniPonAniConfigFsm) PrepareForGarbageCollection(ctx context.Context, aDeviceID string) {
+ logger.Debugw(ctx, "prepare for garbage collection", log.Fields{"device-id": oFsm.deviceID})
+ oFsm.pDeviceHandler = nil
+ oFsm.pOnuDeviceEntry = nil
+ oFsm.pOmciCC = nil
+}