Fixed issue clearing RMI proxy objects on connection close

This commit is contained in:
nathan 2020-08-25 19:47:13 +02:00
parent 42664bfdfe
commit a464d4b231
4 changed files with 4 additions and 8 deletions

View File

@ -301,6 +301,8 @@ open class Connection(connectionParameters: ConnectionParams<*>) {
publication.close()
rmiConnectionSupport.clearProxyObjects()
// this always has to be on a new dispatch, otherwise we can have weird logic loops if we reconnect within a disconnect callback
endPoint.actionDispatch.launch {
// a connection might have also registered for disconnect events

View File

@ -122,8 +122,7 @@ internal class RmiManagerConnections<CONNECTION: Connection>(logger: KLogger,
connection.send(response)
}
override fun close() {
fun clearProxyObjects() {
proxyObjects.clear()
super.close()
}
}

View File

@ -205,8 +205,7 @@ internal class RmiManagerGlobal<CONNECTION : Connection>(logger: KLogger,
return success as T?
}
override fun close() {
super.close()
fun close() {
rmiResponseManager.close()
remoteObjectCreationCallbacks.close()
}

View File

@ -43,8 +43,4 @@ internal open class RmiObjectCache(logger: KLogger) {
fun <T> removeImplObject(rmiId: Int): T? {
return implObjects.remove(rmiId) as T?
}
open fun close() {
implObjects.close()
}
}