Re: filling NSImage with binary data from NSData
Re: filling NSImage with binary data from NSData
- Subject: Re: filling NSImage with binary data from NSData
- From: Uli Kusterer <email@hidden>
- Date: Sun, 7 May 2006 23:53:18 +0200
Am 07.05.2006 um 21:37 schrieb marc joanisse:
vmrData = [NSData dataWithContentsOfFile:fileName];
I may be misremembering here, but aren't you supposed to retain the
data you pass to initWithBitmapDataPlanes: ? What happens right now
is that you're passing a pointer to a part of vmrData to your
NSBitmapImageRep and then autorelease the NSData. Which means as soon
as the pool is collected, your imagerep accesses stale memory because
NSBitmapImageRep doesn't copy the data you give it.
Cheers,
-- M. Uli Kusterer
http://www.zathras.de
_______________________________________________
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