I have a window that contains a NSImageView that displays pictures. here is the code : =====================CODE========================================= NSBitmapImageRep *rawPic = [[[NSBitmapImageRep alloc] initWithBitmapDataPlanes:NULL pixelsWide:thisFrame.width pixelsHigh:thisFrame.height bitsPerSample:8 samplesPerPixel:3 hasAlpha:NO isPlanar:NO colorSpaceName:NSCalibratedRGBColorSpace bitmapFormat:NSAlphaFirstBitmapFormat bytesPerRow:0 bitsPerPixel:0] autorelease]; unsigned char *DestinationRawData = [rawPic bitmapData]; memcpy(DestinationRawData, CurrentFrame, SzCurrentFrame); [self RGB2BGR:DestinationRawData Sz:SzCurrentFrame];
NSImage *NewDisplayImage = [[[NSImage alloc] initWithSize:thisFrame] autorelease]; [NewDisplayImage addRepresentation:rawPic]; [ExternalView setImage:NewDisplayImage]; =====================CODE========================================= The ExternalView display correctly what i want for a while, no memory leak appears but after few seconds the program gives me a bad EXC_BAD_ACCESS. After commenting the last line (setImage) there is absolutely no crash. Thinking of a side-effect i checked all sizes and everything seams to fit..... I also tried to remove the autorelease and replace them by some release after the set image but nothing seams to work. Can anybody see something wrong ? Is there any other way to do what i m doing ? Thanks for the peolple that will help me. Sincerely, -- I. _______________________________________________ Cocoa-dev mailing list ([email protected]) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to [email protected]
