Make sure any JoinedRustRoom is destroyed after use (#4678)
This commit is contained in:
parent
a7179b711c
commit
024aa49e60
5 changed files with 11 additions and 3 deletions
|
|
@ -241,7 +241,7 @@ class CallScreenPresenter @AssistedInject constructor(
|
||||||
|
|
||||||
private suspend fun MatrixClient.notifyCallStartIfNeeded(roomId: RoomId) {
|
private suspend fun MatrixClient.notifyCallStartIfNeeded(roomId: RoomId) {
|
||||||
if (!notifiedCallStart) {
|
if (!notifiedCallStart) {
|
||||||
getJoinedRoom(roomId)?.sendCallNotificationIfNeeded()
|
getJoinedRoom(roomId)?.use { it.sendCallNotificationIfNeeded() }
|
||||||
?.onSuccess { notifiedCallStart = true }
|
?.onSuccess { notifiedCallStart = true }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -47,8 +47,11 @@ class DefaultCallWidgetProvider @Inject constructor(
|
||||||
theme = theme,
|
theme = theme,
|
||||||
).getOrThrow()
|
).getOrThrow()
|
||||||
|
|
||||||
|
val driver = room.getWidgetDriver(widgetSettings).getOrThrow()
|
||||||
|
room.destroy()
|
||||||
|
|
||||||
CallWidgetProvider.GetWidgetResult(
|
CallWidgetProvider.GetWidgetResult(
|
||||||
driver = room.getWidgetDriver(widgetSettings).getOrThrow(),
|
driver = driver,
|
||||||
url = callUrl,
|
url = callUrl,
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -86,6 +86,7 @@ class SharePresenter @AssistedInject constructor(
|
||||||
).isSuccess
|
).isSuccess
|
||||||
}
|
}
|
||||||
.all { it }
|
.all { it }
|
||||||
|
.also { room.destroy() }
|
||||||
}
|
}
|
||||||
.all { it }
|
.all { it }
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -639,9 +639,11 @@ class JoinedRustRoom(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
override fun close() = destroy()
|
||||||
|
|
||||||
override fun destroy() {
|
override fun destroy() {
|
||||||
baseRoom.destroy()
|
baseRoom.destroy()
|
||||||
liveInnerTimeline.close()
|
liveInnerTimeline.destroy()
|
||||||
roomCoroutineScope.cancel()
|
roomCoroutineScope.cancel()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -94,6 +94,8 @@ class RustBaseRoom(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
override fun close() = destroy()
|
||||||
|
|
||||||
override fun destroy() {
|
override fun destroy() {
|
||||||
innerRoom.destroy()
|
innerRoom.destroy()
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue