Fix Use-after-release found by static analyser.

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@32159 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Fred Kiefer 2011-02-14 18:38:11 +00:00
parent c9a8e3c3ae
commit f58e9c1d39
4 changed files with 23 additions and 10 deletions

View file

@ -296,6 +296,7 @@ NSCursor *getStandardCursor(NSString *name, int style)
cursor = [[NSCursor_class alloc] initWithImage: nil];
[GSCurrentServer() standardcursor: GSArrowCursor : &c];
// FIXME: This make the cursor active
[GSCurrentServer() setcursorcolor: [NSColor greenColor]
: [NSColor blackColor] : c];
[cursor _setCid: c];
@ -344,7 +345,10 @@ foregroundColorHint:(NSColor *)fg
backgroundColorHint:(NSColor *)bg
hotSpot:(NSPoint)hotSpot
{
NSCursor *cursor = [self initWithImage: newImage hotSpot: hotSpot];
self = [self initWithImage: newImage hotSpot: hotSpot];
if (self == nil)
return nil;
if (fg || bg)
{
if (bg == nil)
@ -353,9 +357,10 @@ backgroundColorHint:(NSColor *)bg
fg = [NSColor blackColor];
bg = [bg colorUsingColorSpaceName: NSDeviceRGBColorSpace];
fg = [fg colorUsingColorSpaceName: NSDeviceRGBColorSpace];
// FIXME: This make the cursor active
[GSCurrentServer() setcursorcolor: fg : bg : _cid];
}
return cursor;
return self;
}
- (void) dealloc
{