Properly cleanup the remote object storage/cache

This commit is contained in:
Robinson 2023-10-23 23:23:32 +02:00
parent d40c080311
commit 01ab0bf1d8
No known key found for this signature in database
GPG Key ID: 8E7DB78588BD6F5C
3 changed files with 8 additions and 3 deletions

View File

@ -244,7 +244,7 @@ class RemoteObjectStorage(val logger: Logger) {
}
}
fun close() {
fun clear() {
objectMap.clear()
}
}

View File

@ -83,4 +83,8 @@ open class RmiObjectCache(val logger: Logger) {
internal fun restoreImplObjects(implObjects: List<Pair<Int, Any>>) {
this.implObjects.restoreAll(implObjects)
}
internal open fun clear() {
this.implObjects.clear()
}
}

View File

@ -374,8 +374,9 @@ class RmiSupportConnection<CONNECTION: Connection> : RmiObjectCache {
return proxyObject as Iface
}
internal fun clear() {
override fun clear() {
super.clear()
proxyObjects.clear()
remoteObjectCreationCallbacks.close()
remoteObjectCreationCallbacks.clear()
}
}