Cocoa: NSRectFillListWithColors crashes

Posts: 3
Joined: 2009.01
Post: #1
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.

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.
Quote this message in a reply
Post Reply 

Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  Full Screen OpenGL Crashes Blacktiger 13 12,879 Feb 19, 2009 02:39 PM
Last Post: backslash
  Multitexture Crashes Jake 6 5,675 Sep 6, 2004 12:46 PM
Last Post: Jake
  Trying to use SDL crashes GDB(?) Goober 4 5,045 Apr 7, 2003 02:29 AM
Last Post: Goober