This is in reference to the pr0n app...
pr0n0wnsk7 is a standard NSDocument-based app; the document's controller (subclassed NSWindowController) is what allocates and initializes the perl script, then releases it all so it can be initialized and run again. I noticed a vexing memory leak when I was watching my app using top... it seems that if I closed a session window where I had NOT run the script, the controller would receive a WindowShouldClose notification, then the document and controller would deallocate with no problem (I peppered my code with NSLogs to see what was going on). Whereas when I have run the script, the app goes so far as to deallocate the perl task, throws a WindowShouldClose message, closes the window, but does NOT release the document or the controller, thus clogging up my precious RAM. What's odd is that at the point "WindowShouldClose" I NSLog the current reference count of my document class, and it comes out the same both times - one... yet in one case it releases, and in the other, not. WTF?
Here's the chain in any case:
windowDidLoad
setArgs
initScript
startScript
endScript (this releases everything declared in initScript, startScript, and setArgs... enough so that I can reinitialize and start up the script from scratch with new parameters without a problem)
Something is getting retained somewhere that is muching up the whole works... I'll try to post some of the source later but I'm not at my main computer right now. Any ideas?