advertisement

Article:
  Inside StYNCies
Subject:   leaks?
Date:   2005-03-14 09:17:30
From:   ptwobrussell
Response to: leaks?

Patrick,


Thanks for pointing those things out. In the process of taking a full project and breaking up into two pieces for each of the articles, I neglected to remove the mRTFDData references. Those should just be commented out for the moment; they'll be introduced in the next piece as part of a class that's used to read/write from the StickiesDatabase file.


There's no particular reason why I didn't use [NSFileManager defaultManager]. That way is probably more preferred as you seem to imply, however, so there's no reason not to go with it.


As for the dealloc issues involving memory, the dealloc I have here on my machine didn't turn out to be the same one that was published. Amazingly, what is in the article is the first half of AppController's dealloc method joined with the last half of a dealloc method from a class not introduced yet. Not quire sure how that happened; must have been a cut/paste error. Try this one instead:



/*dealloc for AppController */
- (void)dealloc
{
NSNotificationCenter* nc;
nc = [NSNotificationCenter defaultCenter];
[nc removeObserver:self];

[statusItem release];
[prefsController dealloc];
[podUtil dealloc];
[userDefaults dealloc];
[fileManager dealloc];
[super dealloc];
}


As for calling or not calling init in the interface--I know they're inherited from NSObject. It's just my preference to make the interface and implementations match, and something I think of as a good practice. I personally find this to be a good indicator to use for when something's being overridden. Feel free to differ if you have different preferences.


Thanks again for helping to clear those things up.


M.


1 to 2 of 2
  1. leaks?
    2005-03-17 01:47:45  hieper [View]

  2. leaks?
    2005-03-14 13:10:58  hieper [View]

1 to 2 of 2