Singleton "Leaking" Memory?


#1

I have a question about memory / disk management for our ImageCache singleton.

Based on the name alone (“cache” specifically), I assume that this object is, by design, going to have extraneous data.

For example: add a new possession, take a picture, and then delete the possession.
It is my understanding that when you do this, there is still an item in the ImageCache NSDictionary with an inaccessible key since that key is lost because we’ve released the possession object.

Who’s responsibility is it to “clean up” the ImageCache singleton? My gut reaction is that it’ll be the responsibility of the archiver methods to iterate through the possessions array and only save the NSDictionary entries that have corresponding possessions, but Chapter 14 really only writes the binary stream to disk (not an archive of the dictionary object).

So this isn’t technically a leak of memory, but how would you refer to this type of problem?


#2

Looks like this has been discussed over here:
viewtopic.php?f=56&t=330

And as Joe points out there are still some finishing touches left for Homepwner.