diff options
author | nyamatongwe <nyamatongwe@gmail.com> | 2011-11-27 19:38:01 +1100 |
---|---|---|
committer | nyamatongwe <nyamatongwe@gmail.com> | 2011-11-27 19:38:01 +1100 |
commit | 2fd0fab53ae5ac056bc682cec63d1c901411793e (patch) | |
tree | 07e7263a7dc9542be0c6284089ea7ab38a91ceac | |
parent | 87c51f306f4aabe6b384bc786af3045be3e2bb90 (diff) | |
download | scintilla-mirror-2fd0fab53ae5ac056bc682cec63d1c901411793e.tar.gz |
Follow standard pattern as that will work better with ARC if ever used.
-rw-r--r-- | cocoa/PlatCocoa.mm | 6 |
1 files changed, 2 insertions, 4 deletions
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<SurfaceImpl*>(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]; |