Cannot figure out how to get rid of memory leak

Posted by Mark S. on Stack Overflow See other posts from Stack Overflow or by Mark S.
Published on 2010-05-11T17:55:58Z Indexed on 2010/05/11 18:04 UTC
Read the original article Hit count: 240

I'm trying to test for memory leaks in my iphone and I'm not having much luck getting rid of this one. Here is the code that is leaking.


- (id)initWithManagedObjectContext:(NSManagedObjectContext *)aMoc delegate:(id)aDelegate runSync:(BOOL)aRunSync {
    if (self = [super init]) {
        self.moc = aMoc;
        self.settingsManager = [[VacaCalcSettingsManager alloc] initWithManagedObjectContext:self.moc];
        self.delegate = aDelegate;
        calendar = [[NSCalendar alloc] initWithCalendarIdentifier:NSGregorianCalendar];
        self.runSync = aRunSync;
    }

    return self;
}

It is leaking on the self.settingsManager = [[VacaCalcSettingsManager alloc] initWithManagedObjectContext:self.moc]; line.

The self.settingManager instance variable is released in the dealloc method of the class.

I'm not sure what other information would be pertinent. Please let me know and I can provide it.

Thanks for any assistance.

-Mark

© Stack Overflow or respective owner

Related posts about objective-c

Related posts about instruments