Make sure any JoinedRustRoom is destroyed after use (#4678)

This commit is contained in:
Jorge Martin Espinosa 2025-05-05 16:09:07 +02:00 committed by GitHub
parent a7179b711c
commit 024aa49e60
5 changed files with 11 additions and 3 deletions

View file

@ -241,7 +241,7 @@ class CallScreenPresenter @AssistedInject constructor(
private suspend fun MatrixClient.notifyCallStartIfNeeded(roomId: RoomId) {
if (!notifiedCallStart) {
getJoinedRoom(roomId)?.sendCallNotificationIfNeeded()
getJoinedRoom(roomId)?.use { it.sendCallNotificationIfNeeded() }
?.onSuccess { notifiedCallStart = true }
}
}

View file

@ -47,8 +47,11 @@ class DefaultCallWidgetProvider @Inject constructor(
theme = theme,
).getOrThrow()
val driver = room.getWidgetDriver(widgetSettings).getOrThrow()
room.destroy()
CallWidgetProvider.GetWidgetResult(
driver = room.getWidgetDriver(widgetSettings).getOrThrow(),
driver = driver,
url = callUrl,
)
}