Re: Arbitrary polygons crash -[NSBezierPath stroke]
Re: Arbitrary polygons crash -[NSBezierPath stroke]
- Subject: Re: Arbitrary polygons crash -[NSBezierPath stroke]
- From: Tom Bernard <email@hidden>
- Date: Wed, 28 Jun 2006 03:03:54 -0600
If you look again, you will see that while I am enumerating executionList, I
am modifying objectArray, a different NSArray. I do it this way to avoid the
problem you cite.
And if I were stomping memory, the stomped memory would cause a crash
regardless of whether I stroked or filled the polygon; as I said earlier,
the crash only occurs when I stroke the polygon.
I have written a skeleton screensaver that illustrates the problem; I will
post it within the next day.
Thanks for looking :)
Tom Bernard
email@hidden
on 6/27/06 6:31 PM, Uli Kusterer at email@hidden wrote:
> Am 28.06.2006 um 01:05 schrieb Tom Bernard:
>> enumerator = [executionList objectEnumerator];
>> while (anOnScreenObject = [enumerator nextObject])
>> {
>> [anOnScreenObject die];
>> [objectArray removeObject:anOnScreenObject];
>> }
>> [executionList removeAllObjects];
>
> At the top of the docs for NSEnumerator, I found the following note:
>
>>>
> Note: It is not safe to modify a mutable collection while enumerating
> through it. Some enumerators may currently allow enumeration of a
> collection that is modified, but this behavior is not guaranteed to
> be supported in the future.
> <<
>
> So, you may be stomping memory by doing this, thus causing the crash
> that occurs later.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden