Skip to content
Snippets Groups Projects
Verified Commit f20c9a0d authored by Janne Mareike Koschinski's avatar Janne Mareike Koschinski
Browse files

Fixed crash where multiple activities at the same time would subscribe

parent 19ac2d78
No related branches found
No related tags found
No related merge requests found
......@@ -71,8 +71,10 @@ class Session(
)
override val state = coreConnection.state
override val error = ReusableUnicastSubject.create<Error>()
override val connectionError = ReusableUnicastSubject.create<Throwable>()
private val _error = ReusableUnicastSubject.create<Error>()
override val error = _error.publish().refCount()
private val _connectionError = ReusableUnicastSubject.create<Throwable>()
override val connectionError = _connectionError.publish().refCount()
override val aliasManager = AliasManager(this)
override val backlogManager = BacklogManager(this, backlogStorage)
......@@ -116,7 +118,7 @@ class Session(
private fun handleError(error: Error) {
hasErroredCallback?.invoke(error)
this.error.onNext(error)
_error.onNext(error)
}
override fun handle(f: HandshakeMessage.ClientInitAck): Boolean {
......@@ -173,7 +175,7 @@ class Session(
}
fun handleConnectionError(connectionError: Throwable) {
this.connectionError.onNext(connectionError)
_connectionError.onNext(connectionError)
}
fun addNetwork(networkId: NetworkId) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment