-
Notifications
You must be signed in to change notification settings - Fork 33
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
A few leaks found #1
Comments
Glad I read this issue before adding this to my project. |
I found some leaks and fixed them. I attached the patch. |
From and email: |
I had posted this original message back on June 2 and was wondering if you would have an updated version of the code soon with the memory leaks fixed? Thanks |
I haven't been writing iOS apps recently so I haven't looked into this issue. |
I'll need to look into this, hopefully it's fixed with ARC |
First, a big thanks for this code!!
After running my app through Instruments, I found a few leaks. Below is the info I extracted from Instruments. Let me know if you need anything else.
LEAKED OBJECT: Malloc 16 bytes EVENT TYPE: Malloc RESPONSIBLE CALLER: [InAppSettingsReaderRegisterDefaults loadFile]
load plist NSDictionary *settingsDictionary = [[NSDictionary alloc] initWithContentsOfFile:InAppSettingsFullPlistPath(file)]; NSArray *preferenceSpecifiers = [settingsDictionary objectForKey:InAppSettingsPreferenceSpecifiers]; NSString *stringsTable = [settingsDictionary objectForKey:InAppSettingsStringsTable];
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; for(NSDictionary *eachSetting in preferenceSpecifiers){ InAppSettingsSpecifier *setting = [[InAppSettingsSpecifier alloc] initWithDictionary:eachSetting andStringsTable:stringsTable]; if([setting isValid]){ if([setting isType:InAppSettingsPSChildPaneSpecifier]){ [self loadFile:[setting valueForKey:InAppSettingsSpecifierFile]]; }else if([setting hasKey]){ if([setting valueForKey:InAppSettingsSpecifierDefaultValue]){ [self.values setObject:[setting valueForKey:InAppSettingsSpecifierDefaultValue] forKey:[setting getKey]]; } } } [setting release]; } [pool drain]; [settingsDictionary release]; } }
LEAKED OBJECT: NSCFDictionary EVENT TYPE: Malloc RESPONSIBLE CALLER: [InAppSettingsReaderRegisterDefaults init]
LEAKED OBJECT: NSCFDictionary EVENT TYPE: CFRetain RESPONSIBLE CALLER: [InAppSettingsReaderRegisterDefaults setValues]
NO CODE HIGHLIGHTED FOR THIS ONE AND I DIDN'T EVEN SEE THIS METHOD **
LEAKED OBJECT: NSCFDictionary EVENT TYPE: CFRelease RESPONSIBLE CALLER: [InAppSettingsReaderRegisterDefaults dealloc]
NO CODE HIGHLIGHTED FOR THIS ONE **
LEAKED OBJECT: NSArrayM EVENT TYPE: Malloc RESPONSIBLE CALLER: [InAppSettingsReaderRegisterDefaults init]
LEAKED OBJECT: NSArrayM EVENT TYPE: Retain RESPONSIBLE CALLER: [InAppSettingsReaderRegisterDefaults setValues]
NO CODE HIGHLIGHTED FOR THIS ONE AND I DIDN'T EVEN SEE THIS METHOD **
LEAKED OBJECT: NSArrayM EVENT TYPE: Release RESPONSIBLE CALLER: [InAppSettingsReaderRegisterDefaults dealloc]
NO CODE HIGHLIGHTED FOR THIS ONE **
The text was updated successfully, but these errors were encountered: