From: Jason Harris <smeger@ge...> - 2004-08-25 00:37:26
I changed ServerDataManager's applicationWillTerminate method. It now
contains only the following line:
BTW, writing to defaults is a relatively "cheap" operation,
synchronizing the defaults is what's expensive, but we can generally
use auto-syncing and not worry about it. So we may wish to 'save'
whenever a server is changed instead of just when the app quits.
Of course, archiving the servers is probably pretty "expensive" too, so
On Aug 24, 2004, at 5:11 PM, Jared McIntyre wrote:
>> Just a heads up to let everyone know I've resolved the problem with
>> servers not saving when Chicken is quit.
> What did you do to fix it? I have the code ready for both Rendezvous
> types, and I want to make sure I don't screw up your work.
From: Jason Harris <smeger@ge...> - 2004-08-25 08:27:31
It's not getting released because the individual servers are retaining
the data manager when it's given to them as a delegate, but the data
manager owns the individual servers, so there's a retain-loop.
Since ServerDataManager is a singleton and is guaranteed to be alive
during the entire app run, we probably don't need to retain the
delegate, which would fix the issue.
I personally think it's bad form to retain delegates anyway, precisely
because it _does_ tend to cause retain-loops like this.
I've made this change and checked it in. So now, the
applicationWillTerminate releases the singleton, and ServerBase doesn't
retain its delegate.
On Aug 24, 2004, at 9:15 PM, Jared McIntyre wrote:
>> I changed ServerDataManager's applicationWillTerminate method. It
>> now contains only the following line:
>> [self save];
> I'd rather we figured out what is holding onto ServerDataManager and
> make it release it. I highly dislike the practice of allowing
> singletons to not be cleaned up at delete because it makes trying to
> find real memory leaks significantly harder. That's why
> ServerDataManager's applicationWillTerminate function (and other
> singeltons I've added to the project) release the instance (which used
> to cause the memory to be freed, but doesn't any more).