mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-05-29 19:07:38 +00:00
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:
parent
c9a8e3c3ae
commit
f58e9c1d39
4 changed files with 23 additions and 10 deletions
|
@ -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
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue