In Apple's NSObject documentation, NSZoneFree is called in the - (void)dealloc example code:
- (void)dealloc {
[companion release];
NSZoneFree(private, [self zone])
[super dealloc];
}
You can find it in context over here.
I never had the notion that I should be calling NSZoneFree in my own NSObject subclasses (or what NS_WhateverClass_ subclasses) and can't find anything conclusive on the topic anywhere in the docs.
All I can find about using NSZoneFree is a brief mention in the Memory Management Programming Guide, and an explanation of the function in the Foundation Functions Reference, but none of these docs make it clear to me whether I should worry about it in the context of a dealloc method.
Can anybody clarify when I should put an NSZoneFree call in my own classes' dealloc implementations?
Edit: Thanks for your replies, it's clearer to me now :) — Dirk