Skip to content

Commit

Permalink
Release managed room when rememberLiveKitRoom leaves composition
Browse files Browse the repository at this point in the history
  • Loading branch information
davidliu committed Apr 1, 2024
1 parent ff48148 commit 426c86f
Showing 1 changed file with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,13 @@ fun rememberLiveKitRoom(
}
}
}
DisposableEffect(room, passedRoom) {
onDispose {
if (room != passedRoom) {
room.release()
}
}
}
return room
}

Expand Down

0 comments on commit 426c86f

Please sign in to comment.