Cocoa: NSRectFillListWithColors crashes
I'm using NSRectFillListWithColors on a CustomView to draw a chess board and so far it works great. Except I just discovered that if I minimize the main window, then restore it, my app crashes with a "EXC_BAD_ACCESS."
NSRectFillListWithColors is being called in my CustomView's drawRect method, I am not forcing this view to redraw. I basically stripped my app down to just the important parts needed to draw a plain ol' chess board. I just don't understand what the problem is.
***Solved***
The NSColor objects I used for alternating the checkered pattern were only in the scope of initWithFrame where I did all my initialization. The array of NSColors passed to NSRectFillListWithColors resulted in copies of those pointers, not new NSColor objects that would persist. Rookie mistake.
NSRectFillListWithColors is being called in my CustomView's drawRect method, I am not forcing this view to redraw. I basically stripped my app down to just the important parts needed to draw a plain ol' chess board. I just don't understand what the problem is.
***Solved***
The NSColor objects I used for alternating the checkered pattern were only in the scope of initWithFrame where I did all my initialization. The array of NSColors passed to NSRectFillListWithColors resulted in copies of those pointers, not new NSColor objects that would persist. Rookie mistake.
Possibly Related Threads...
| Thread: | Author | Replies: | Views: | Last Post | |
| Full Screen OpenGL Crashes | Blacktiger | 13 | 6,590 |
Feb 19, 2009 02:39 PM Last Post: backslash |
|
| Multitexture Crashes | Jake | 6 | 3,242 |
Sep 6, 2004 12:46 PM Last Post: Jake |
|
| Trying to use SDL crashes GDB(?) | Goober | 4 | 3,189 |
Apr 7, 2003 02:29 AM Last Post: Goober |
|

