瀏覽代碼

fix(virtual-background): Prevent memory leak when desktop share as a virtual background is applied.

master
tudordan7 4 年之前
父節點
當前提交
52ee9b5151
共有 1 個檔案被更改,包括 2 行新增1 行删除
  1. 2
    1
      react/features/virtual-background/middleware.js

+ 2
- 1
react/features/virtual-background/middleware.js 查看文件

4
 import { MiddlewareRegistry } from '../base/redux';
4
 import { MiddlewareRegistry } from '../base/redux';
5
 import { getLocalVideoTrack } from '../base/tracks';
5
 import { getLocalVideoTrack } from '../base/tracks';
6
 
6
 
7
+import { SET_VIRTUAL_BACKGROUND } from './actionTypes';
7
 import { localTrackStopped } from './functions';
8
 import { localTrackStopped } from './functions';
8
 
9
 
9
 /**
10
 /**
19
     const virtualSource = getState()['features/virtual-background'].virtualSource;
20
     const virtualSource = getState()['features/virtual-background'].virtualSource;
20
     const currentLocalTrack = getLocalVideoTrack(getState()['features/base/tracks']);
21
     const currentLocalTrack = getLocalVideoTrack(getState()['features/base/tracks']);
21
 
22
 
22
-    if (virtualSource?.videoType === VIDEO_TYPE.DESKTOP) {
23
+    if (virtualSource?.videoType === VIDEO_TYPE.DESKTOP && action.type === SET_VIRTUAL_BACKGROUND) {
23
         localTrackStopped(dispatch, virtualSource, currentLocalTrack?.jitsiTrack);
24
         localTrackStopped(dispatch, virtualSource, currentLocalTrack?.jitsiTrack);
24
     }
25
     }
25
 
26
 

Loading…
取消
儲存