From f43d2b475dd1985ac9f420b35fefea74f3fc7fe5 Mon Sep 17 00:00:00 2001 From: nyamatongwe Date: Sun, 27 Nov 2011 19:38:01 +1100 Subject: Follow standard pattern as that will work better with ARC if ever used. --- cocoa/PlatCocoa.mm | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'cocoa') diff --git a/cocoa/PlatCocoa.mm b/cocoa/PlatCocoa.mm index 5703a76f8..027fd6416 100644 --- a/cocoa/PlatCocoa.mm +++ b/cocoa/PlatCocoa.mm @@ -1333,8 +1333,7 @@ static NSImage* ImageFromXPM(XPM* pxpm) SurfaceImpl* surfaceIXPM = static_cast(surfaceXPM); CGContextClearRect(surfaceIXPM->GetContext(), CGRectMake(0, 0, width, height)); pxpm->Draw(surfaceXPM, rcxpm); - img = [[NSImage alloc] initWithSize:NSZeroSize]; - [img autorelease]; + img = [[[NSImage alloc] initWithSize:NSZeroSize] autorelease]; CGImageRef imageRef = surfaceIXPM->GetImage(); NSBitmapImageRep *bitmapRep = [[NSBitmapImageRep alloc] initWithCGImage: imageRef]; [img addRepresentation: bitmapRep]; @@ -1796,8 +1795,7 @@ void ListBoxImpl::RegisterImage(int type, const char* xpm_data) void ListBoxImpl::RegisterRGBAImage(int type, int width, int height, const unsigned char *pixelsImage) { CGImageRef imageRef = ImageCreateFromRGBA(width, height, pixelsImage, false); NSSize sz = {width, height}; - NSImage *img = [[NSImage alloc] initWithSize: sz]; - [img autorelease]; + NSImage *img = [[[NSImage alloc] initWithSize: sz] autorelease]; NSBitmapImageRep *bitmapRep = [[NSBitmapImageRep alloc] initWithCGImage: imageRef]; [img addRepresentation: bitmapRep]; [bitmapRep release]; -- cgit v1.2.3