File tree Expand file tree Collapse file tree 1 file changed +11
-0
lines changed Expand file tree Collapse file tree 1 file changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -131,6 +131,17 @@ - (void)startObserving
131131- (void )stopObserving
132132{
133133 _hasListeners = FALSE ;
134+
135+ // Fix for https://github.com/react-native-webrtc/react-native-callkeep/issues/406
136+ // We use Objective-C Key Value Coding(KVC) to sync _RTCEventEmitter_ `_listenerCount`.
137+ @try {
138+ [self setValue: @0 forKey: @" _listenerCount" ];
139+ }
140+ @catch ( NSException *e ){
141+ NSLog (@" [RNCallKeep][stopObserving] exception: %@ " ,e);
142+ NSLog (@" [RNCallKeep][stopObserving] RNCallKeep parent class RTCEventEmitter might have a broken state." );
143+ NSLog (@" [RNCallKeep][stopObserving] Please verify that the parent RTCEventEmitter.m has iVar `_listenerCount`." );
144+ }
134145}
135146
136147- (void )onAudioRouteChange : (NSNotification *)notification
You can’t perform that action at this time.
0 commit comments