I am developing an objective C framework which will ship as a static library at the end. But when I integrate that library to an actual application (by adding the static library) in the leaks tools I see some memory leaks present.
Here is an example scenario.
@implementation Test
@synthesize testNumber
+(Test) createTestInstance {
Test *test = [[Test alloc] init];
test.testNumber = [[NSDecimerNumber alloc] initWithInt:1];
return test;
}
-(void) dealloc {
[testNumber release];
}
@end
Although I release testNumber variable in dealloc I see a memory leak in Leaks tool at alloc position. What can be the issue here?
Also as this is a library provided for user to invoke, is it a best practice to release those variable from the library code?
Thank You