GitHub Issue | n/a |
Type | Bug |
Priority | High |
Status | Closed |
Resolution | Duplicate |
Resolution Date | 2013-07-22T23:43:15.000+0000 |
Affected Version/s | Release 2.1.4, Release 3.0.2, Release 3.1.0, Release 3.1.1 |
Fix Version/s | 2013 Sprint 15 API, 2013 Sprint 15, Release 3.2.0, Release 3.2.3 |
Components | iOS |
Labels | ios, mobile, mobilesdk, qe-closed-3.2.3, titanium |
Reporter | Ashish Nigam |
Assignee | Ingo Muschenetz |
Created | 2013-07-09T09:29:07.000+0000 |
Updated | 2014-06-19T12:43:14.000+0000 |
Whenever i set any property in tiapp.xml, application reports a memory leak when analyzed using Instrument.
Steps to reproduce:
1: Create a sample application and either cloud enable this or set
any property like this in the tiapp.xml
system
2: Build the application using titanium studio.
3: analyze the application using instrument for memory leaks.
4: after few seconds, instrument will show memory leaks.
5: check the source file for leak.
6: ApplicationDefault.m will be reported for leaks.
6: Code written there and responsible for leak is:
@implementation ApplicationDefaults
+ (NSMutableDictionary*) copyDefaults
{
NSMutableDictionary * _property = [[NSMutableDictionary alloc] init];
[_property setObject:[TiUtils stringValue:@"system"] forKey:@"ti.ui.defaultunit"];
return _property;
}
@end
.
Possible Solution:
As per my understanding and finding, dictionary object should have been autoreleased while creating, so the above sample must have been written like:
@implementation ApplicationDefaults
+ (NSMutableDictionary*) copyDefaults
{
NSMutableDictionary * _property = [[[NSMutableDictionary alloc] init] autorelease];
[_property setObject:[TiUtils stringValue:@"system"] forKey:@"ti.ui.defaultunit"];
return _property;
}
@end
This is a dupe issue and has already been fixed since 3.0.0
Verified as FIXED using : OSX: 10.9.2 Xcode:5.1.1 acs@1.0.14 alloy@1.3.1 npm@1.3.2 titanium@3.2.3-beta2 titanium-code-processor@1.1.1-beta1 MobileSDK :3.2.3.v20140418101718 ,3.3.0.v20140418162516 Appcelerator Studio, build: 3.2.3.201404162038 Devices Used : iPhone 5s (7.1) ; iPod touch (7.1) No memory leaks have been noticed by adding