aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authornyamatongwe <nyamatongwe@gmail.com>2011-11-27 19:38:01 +1100
committernyamatongwe <nyamatongwe@gmail.com>2011-11-27 19:38:01 +1100
commitf43d2b475dd1985ac9f420b35fefea74f3fc7fe5 (patch)
tree4118cf71bec5b13013db3594b010a1e83288302e
parenta3533121defe1542aaf59cb396820ea4ac5c0a70 (diff)
downloadscintilla-mirror-f43d2b475dd1985ac9f420b35fefea74f3fc7fe5.tar.gz
Follow standard pattern as that will work better with ARC if ever used.
-rw-r--r--cocoa/PlatCocoa.mm6
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];