firebase / firebase-ios-sdk

Firebase SDK for Apple App Development
https://firebase.google.com
Apache License 2.0
5.67k stars 1.49k forks source link

Memory leak in [RCNConfigFetch URLSessionDataTaskWithContent:completionHandler:] #1647

Closed MaratIbragimov closed 6 years ago

MaratIbragimov commented 6 years ago

[READ] Step 1: Are you in the right place?

YES

[REQUIRED] Step 2: Describe your environment

[REQUIRED] Step 3: Describe the problem

Memory leak in [RCNConfigFetch URLSessionDataTaskWithContent:completionHandler:] (retain cycle) screen shot 2018-08-07 at 11 07 51

Steps to reproduce:

Executing Firebase config initialization and fetching of remote config data

Relevant Code:

In application:didFinishLaunchingWithOptions: [FIRApp configure]; self.remoteConfig = [FIRRemoteConfig remoteConfig]; FIRRemoteConfigSettings *remoteConfigSettings = [[FIRRemoteConfigSettings alloc] initWithDeveloperModeEnabled:YES]; self.remoteConfig.configSettings = remoteConfigSettings;

long expirationDuration = 3600; weak typeof (self)weakSelf = self; [self.remoteConfig fetchWithExpirationDuration:expirationDuration completionHandler:^(FIRRemoteConfigFetchStatus status, NSError *error) { strong typeof (weakSelf) strongSelf = weakSelf; if (status == FIRRemoteConfigFetchStatusSuccess) [strongSelf.remoteConfig activateFetched]; }];

morganchen12 commented 6 years ago

This looks like an issue that was reported here and subsequently fixed, but has not yet been released. @chliangGoogle can you make sure this makes its way into M31?

charlotteliang commented 6 years ago

I think this has just released in M30.

morganchen12 commented 6 years ago

@marat643 can you try with Firebase 5.5.0 and see if you still have the leak?

MaratIbragimov commented 6 years ago

Yes, Thank you very much, it solved the issue, there is another leak in [APMUserDefaults objectForKey:], but I saw that you are handling it in another opened issue, so I'll wait for the next release.

Thank you once again :)

edwardmp commented 6 years ago

I concur that there still is another leak in [APMUserDefaults objectForKey:]