Re: One Shot Windows: WARNING
Re: One Shot Windows: WARNING
- Subject: Re: One Shot Windows: WARNING
- From: Michael Ash <email@hidden>
- Date: Wed, 11 Feb 2009 23:34:02 -0500
On Wed, Feb 11, 2009 at 4:06 PM, Seth Willits <email@hidden> wrote:
> On Feb 10, 2009, at 9:12 PM, Michael Ash wrote:
>
>>> The behavior of non-one shot windows is obviously not clear.
>>
>> Forgive me for saying this, but this sounds a lot like the common
>> newbie complaints about Cocoa memory management.
>
> It's more than memory management.
>
> For example, why does a non-one-shot window even redraw after it's already
> been closed?
Because the window's backing store still exists, so the window still
needs to be updated. True, it has become a useless task since the
window is going away, but there's no flag that gets set to say, "this
window is being destroyed, stop updating it".
>> In short, you have a memory management problem. As is often the nature
>> of memory management problems, it only manifested under certain
>> circumstances. But this doesn't mean that there needs to be a special
>> warning about those circumstances, it only means that you need to not
>> write this kind of bug.
>
> Except if you had spent two hours trying to figure out what was going on,
> you'd be happy to have read a thread warning that a tiny inconspicuous
> checkbox does more than the documentation leads on to. ;-)
The point is that it's useless to have these specific warnings when
the actual problem is something much more general. The lesson to be
learned here is, "clear your weak references in -dealloc". Nothing to
do with one-shot, and the documentation about the one-shot option
would not be the place to put it.
Mike
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden