I have a small test app I've been working on that runs on Leopard in
64 bit that uses NSOperation to do its threading, and am crashing in
code that looks like the following. Unfortunately, when I run this on
several hundred images, it, occasionally (but consistently) crashes in
the drawInRect:.
Now perhaps this has to run in the main thread, but I don't seem to
remember that as a restriction (but I could just be blocking that
info). I know that I could use ImageIO to get the thumbnail (and
probably will), but I have to read the NSImage anyway, since I'm about
to hand this image to QTKit, which only takes an NSImage.
Here's what the stack trace looks like:
#0 0x805e7a3e in objc_msgSend
#1 0x83d980c6 in _NXAllocateImageCache
#2 0x83d97720 in -[NSCachedImageRep
_initWithSize:depth:separate:alpha:allowDeep:]
#3 0x83d9a9e4 in -[NSImage _focusOnCache:creatingWithSizeInPixels:]
#4 0x83d9a3fc in -[NSImage
_cacheRepresentation:toSizeInPixels:stayFocused:]
#5 0x83d9340f in -[NSImage drawInRect:fromRect:operation:fraction:]
and here's the code in the -main of the operation: