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() 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 // 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 { endPoint.actionDispatch.launch {
// a connection might have also registered for disconnect events // 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) connection.send(response)
} }
override fun close() { fun clearProxyObjects() {
proxyObjects.clear() proxyObjects.clear()
super.close()
} }
} }

View File

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

View File

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