bugfix(ios) changes the participantInfo completion handler reference to strong.

When the method was called from Swift they were collected before calling them.
This commit is contained in:
tmoldovan8x8 2021-02-09 18:03:25 +02:00 committed by GitHub
parent 579acbc570
commit ef6b641802
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -30,7 +30,7 @@ static NSMapTable<NSString*, void (^)(NSArray* participantsInfo)> *participantIn
__attribute__((constructor)) __attribute__((constructor))
static void initializeViewsMap() { static void initializeViewsMap() {
participantInfoCompletionHandlers = [NSMapTable strongToWeakObjectsMapTable]; participantInfoCompletionHandlers = [NSMapTable strongToStrongObjectsMapTable];
} }
RCT_EXPORT_MODULE(); RCT_EXPORT_MODULE();
@ -160,7 +160,7 @@ RCT_EXPORT_METHOD(sendEvent:(NSString *)name
NSString *completionHandlerId = [[NSUUID UUID] UUIDString]; NSString *completionHandlerId = [[NSUUID UUID] UUIDString];
NSDictionary *data = @{ @"requestId": completionHandlerId}; NSDictionary *data = @{ @"requestId": completionHandlerId};
[participantInfoCompletionHandlers setObject:completionHandler forKey:completionHandlerId]; [participantInfoCompletionHandlers setObject:[completionHandler copy] forKey:completionHandlerId];
[self sendEventWithName:retrieveParticipantsInfoAction body:data]; [self sendEventWithName:retrieveParticipantsInfoAction body:data];
} }