File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -519,7 +519,7 @@ class Room extends DisposableChangeNotifier with EventsEmittable<RoomEvent> {
519519 })
520520 ..on < EngineDisconnectedEvent > ((event) async {
521521 if (! engine.fullReconnectOnNext) {
522- await _cleanUp ();
522+ await _cleanUp (disposeLocalParticipant : false );
523523 events.emit (RoomDisconnectedEvent (reason: event.reason));
524524 notifyListeners ();
525525 }
@@ -887,7 +887,7 @@ class Room extends DisposableChangeNotifier with EventsEmittable<RoomEvent> {
887887
888888extension RoomPrivateMethods on Room {
889889 // resets internal state to a re-usable state
890- Future <void > _cleanUp () async {
890+ Future <void > _cleanUp ({ bool disposeLocalParticipant = true } ) async {
891891 logger.fine ('[${objectId }] cleanUp()' );
892892
893893 // clean up RemoteParticipants
@@ -903,6 +903,11 @@ extension RoomPrivateMethods on Room {
903903 // clean up LocalParticipant
904904 await localParticipant? .unpublishAllTracks ();
905905
906+ if (disposeLocalParticipant) {
907+ await localParticipant? .dispose ();
908+ _localParticipant = null ;
909+ }
910+
906911 _activeSpeakers.clear ();
907912
908913 // clean up engine
You can’t perform that action at this time.
0 commit comments