Browse Source

fix. attachted more remove listener

matrixbirds 5 years ago
parent
commit
1195755cb9
3 changed files with 5 additions and 5 deletions
  1. 2
    2
      lib/RtcEngine.native.js
  2. 1
    1
      lib/RtcEngine.native.js.map
  3. 2
    2
      src/RtcEngine.native.ts

+ 2
- 2
lib/RtcEngine.native.js View File

@@ -53,7 +53,7 @@ class RtcEngine {
53 53
      * @param eventType
54 54
      */
55 55
     static off(eventType) {
56
-        AgoraEventEmitter.removeAllListeners(eventType);
56
+        AgoraEventEmitter.removeListener(eventType, () => { });
57 57
         this.eventTypes.delete(eventType);
58 58
     }
59 59
     /**
@@ -65,7 +65,7 @@ class RtcEngine {
65 65
      */
66 66
     static removeAllListeners() {
67 67
         for (let eventType of this.eventTypes) {
68
-            AgoraEventEmitter.removeAllListeners(eventType);
68
+            AgoraEventEmitter.removeListener(eventType, () => { });
69 69
         }
70 70
         this.eventTypes.clear();
71 71
     }

+ 1
- 1
lib/RtcEngine.native.js.map
File diff suppressed because it is too large
View File


+ 2
- 2
src/RtcEngine.native.ts View File

@@ -86,7 +86,7 @@ class RtcEngine {
86 86
      * @param eventType
87 87
      */
88 88
     public static off(eventType: string) {
89
-        AgoraEventEmitter.removeAllListeners(eventType);
89
+        AgoraEventEmitter.removeListener(eventType, () => {});
90 90
         this.eventTypes.delete(eventType);
91 91
     }
92 92
 
@@ -99,7 +99,7 @@ class RtcEngine {
99 99
      */
100 100
     public static removeAllListeners() {
101 101
         for (let eventType of this.eventTypes) {
102
-            AgoraEventEmitter.removeAllListeners(eventType);
102
+            AgoraEventEmitter.removeListener(eventType, () => {});
103 103
         }
104 104
         this.eventTypes.clear();
105 105
     }