diff options
| author | nyamatongwe <nyamatongwe@gmail.com> | 2011-10-29 11:53:16 +1100 | 
|---|---|---|
| committer | nyamatongwe <nyamatongwe@gmail.com> | 2011-10-29 11:53:16 +1100 | 
| commit | 1fa26e53a08ea20ea45244d16602e8e482bdb8f0 (patch) | |
| tree | 90ce0136a5ab5dcf7883a64fa502d82fe6ca1169 | |
| parent | aaf1b69f0771dcea6551d194cdae24af9585cbe9 (diff) | |
| download | scintilla-mirror-1fa26e53a08ea20ea45244d16602e8e482bdb8f0.tar.gz | |
Fix warnings from Clang analyze about memory management.
| -rw-r--r-- | cocoa/PlatCocoa.mm | 6 | ||||
| -rw-r--r-- | cocoa/ScintillaCocoa.mm | 4 | 
2 files changed, 5 insertions, 5 deletions
diff --git a/cocoa/PlatCocoa.mm b/cocoa/PlatCocoa.mm index 02a000b39..7f0d86813 100644 --- a/cocoa/PlatCocoa.mm +++ b/cocoa/PlatCocoa.mm @@ -612,7 +612,7 @@ void Scintilla::SurfaceImpl::AlphaRectangle(PRectangle rc, int /*cornerSize*/, C    }  } -static CGImageRef ImageFromRGBA(int width, int height, const unsigned char *pixelsImage, bool invert) { +static CGImageRef ImageCreateFromRGBA(int width, int height, const unsigned char *pixelsImage, bool invert) {  	CGImageRef image = 0;  	// Create an RGB color space. @@ -666,7 +666,7 @@ static CGImageRef ImageFromRGBA(int width, int height, const unsigned char *pixe  }  void SurfaceImpl::DrawRGBAImage(PRectangle /* rc */, int width, int height, const unsigned char *pixelsImage) { -	CGImageRef image = ImageFromRGBA(width, height, pixelsImage, true); +	CGImageRef image = ImageCreateFromRGBA(width, height, pixelsImage, true);  	if (image) {  		//CGContextSaveGState(gc);  		//CGRect dst = PRectangleToCGRect(rc); @@ -1794,7 +1794,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 = ImageFromRGBA(width, height, pixelsImage, false); +	CGImageRef imageRef = ImageCreateFromRGBA(width, height, pixelsImage, false);  	NSSize sz = {width, height};  	NSImage *img = [[NSImage alloc] initWithSize: sz];  	[img autorelease]; diff --git a/cocoa/ScintillaCocoa.mm b/cocoa/ScintillaCocoa.mm index eb3fbc50c..0b4fe6294 100644 --- a/cocoa/ScintillaCocoa.mm +++ b/cocoa/ScintillaCocoa.mm @@ -138,7 +138,7 @@ static const KeyToCommand macMapDefault[] =  - (id) init: (void*) target  { -  [super init]; +  self = [super init];    if (self != nil)    {      mTarget = target; @@ -543,7 +543,7 @@ sptr_t ScintillaCocoa::WndProc(unsigned int iMessage, uptr_t wParam, sptr_t lPar        // performed.        if (IsUnicodeMode())        { -        NSString* input = [[NSString stringWithCharacters: (const unichar*) &wParam length: 1] autorelease]; +        NSString* input = [NSString stringWithCharacters: (const unichar*) &wParam length: 1];          const char* utf8 = [input UTF8String];          AddCharUTF((char*) utf8, static_cast<unsigned int>(strlen(utf8)), false);          return 1;  | 
