[VOL-4548] openonuAdapterGo - memory leak seen in long term tests
Change-Id: Ie3eb2048cebf8bf8b2f2a99ccd927d462000223a
diff --git a/internal/pkg/avcfg/omci_vlan_config.go b/internal/pkg/avcfg/omci_vlan_config.go
index 668d2c6..e97b0be 100755
--- a/internal/pkg/avcfg/omci_vlan_config.go
+++ b/internal/pkg/avcfg/omci_vlan_config.go
@@ -3229,3 +3229,11 @@
}
}
}
+
+// PrepareForGarbageCollection - remove references to prepare for garbage collection
+func (oFsm *UniVlanConfigFsm) PrepareForGarbageCollection(ctx context.Context, aDeviceID string) {
+ logger.Debugw(ctx, "prepare for garbage collection", log.Fields{"device-id": aDeviceID})
+ oFsm.pDeviceHandler = nil
+ oFsm.pOnuDeviceEntry = nil
+ oFsm.pOmciCC = nil
+}