fix(tracks) fix disposing of local tracks
Don't just clear the storage for them, local tracks must be disposed, in order for RN capturer to be freed for example.
This commit is contained in:
parent
f8908c143e
commit
9279586e8c
|
@ -31,6 +31,7 @@ import {
|
|||
} from './actionTypes';
|
||||
import {
|
||||
createLocalTracksA,
|
||||
destroyLocalTracks,
|
||||
showNoDataFromSourceVideoError,
|
||||
toggleScreensharing,
|
||||
trackRemoved,
|
||||
|
@ -217,10 +218,11 @@ StateListenerRegistry.register(
|
|||
(conference, { dispatch, getState }, prevConference) => {
|
||||
if (prevConference && !conference) {
|
||||
// Clear all tracks.
|
||||
const tracks = getState()['features/base/tracks'];
|
||||
const remoteTracks = getState()['features/base/tracks'].filter(t => !t.local);
|
||||
|
||||
batch(() => {
|
||||
for (const track of tracks) {
|
||||
dispatch(destroyLocalTracks());
|
||||
for (const track of remoteTracks) {
|
||||
dispatch(trackRemoved(track.jitsiTrack));
|
||||
}
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue