Skip to content
This repository was archived by the owner on Jan 18, 2023. It is now read-only.
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions src/ios/OpenTokPlugin.m
Original file line number Diff line number Diff line change
Expand Up @@ -444,7 +444,7 @@ - (void)subscriberVideoDisableWarningLifted:(OTSubscriberKit*)sub{
- (void)subscriberVideoEnabled:(OTSubscriberKit*)sub reason:(OTSubscriberVideoEventReason)reason{
NSMutableDictionary* eventData = [[NSMutableDictionary alloc] init];
NSString* reasonData = [self validateReason: reason];

[eventData setObject: reasonData forKey:@"reason"];
[self triggerJSEvent: @"subscriberEvents" withType: @"videoEnabled" withData: eventData];
}
Expand Down Expand Up @@ -610,6 +610,12 @@ - (void)sessionDidDisconnect:(OTSession*)session{
if( _publisher ){
[_publisher.view removeFromSuperview];
}
// Remove session observers
for ( id key in streamDictionary ) {
[self removeObserversFromStream: [streamDictionary objectForKey:key]];
}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should maybe also remove all objects within the streamDictionary then for memory sake(like a few lines above) [streamDictionary removeAllObjects].

Copy link

@msach22 msach22 May 17, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree that we should free up resources and remove all objects. @amatakasap can you please update the PR and add that?


[streamDictionary removeAllObjects];

// Setting up event object
NSMutableDictionary* eventData = [[NSMutableDictionary alloc] init];
Expand Down Expand Up @@ -776,4 +782,4 @@ - (void)triggerJSEvent:(NSString*)event withType:(NSString*)type withData:(id) d
******/


@end
@end