mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-05-31 22:00:46 +00:00
Minor performance improvements - don't send mesages to nil.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@4214 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
442bdb5265
commit
01d09ad926
2 changed files with 15 additions and 8 deletions
|
@ -57,7 +57,8 @@
|
||||||
rectangle = aRect;
|
rectangle = aRect;
|
||||||
tag = aTag;
|
tag = aTag;
|
||||||
owner = anObject;
|
owner = anObject;
|
||||||
[owner retain];
|
if (owner)
|
||||||
|
[owner retain];
|
||||||
user_data = theData;
|
user_data = theData;
|
||||||
inside = flag;
|
inside = flag;
|
||||||
isValid = YES;
|
isValid = YES;
|
||||||
|
@ -66,7 +67,8 @@
|
||||||
|
|
||||||
- (void) dealloc
|
- (void) dealloc
|
||||||
{
|
{
|
||||||
[owner release];
|
if (owner)
|
||||||
|
[owner release];
|
||||||
[super dealloc];
|
[super dealloc];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -105,8 +107,11 @@
|
||||||
if (isValid)
|
if (isValid)
|
||||||
{
|
{
|
||||||
isValid = NO;
|
isValid = NO;
|
||||||
[owner release];
|
if (owner)
|
||||||
owner = nil;
|
{
|
||||||
|
[owner release];
|
||||||
|
owner = nil;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -209,7 +209,7 @@ static NSDictionary* nsmapping = nil;
|
||||||
NSDebugLog(@"extension %s\n", [o cString]);
|
NSDebugLog(@"extension %s\n", [o cString]);
|
||||||
path = [main pathForResource: the_name
|
path = [main pathForResource: the_name
|
||||||
ofType: o];
|
ofType: o];
|
||||||
if ([path length] != 0)
|
if (path != nil && [path length] != 0)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -237,7 +237,7 @@ static NSDictionary* nsmapping = nil;
|
||||||
path = [system pathForResource: the_name
|
path = [system pathForResource: the_name
|
||||||
ofType: o
|
ofType: o
|
||||||
inDirectory: NSImage_PATH];
|
inDirectory: NSImage_PATH];
|
||||||
if ([path length] != 0)
|
if (path != nil && [path length] != 0)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -392,7 +392,8 @@ static NSDictionary* nsmapping = nil;
|
||||||
return NO;
|
return NO;
|
||||||
|
|
||||||
[string retain];
|
[string retain];
|
||||||
[name release];
|
if (name)
|
||||||
|
[name release];
|
||||||
name = string;
|
name = string;
|
||||||
|
|
||||||
[nameDict setObject: self forKey: name];
|
[nameDict setObject: self forKey: name];
|
||||||
|
@ -519,7 +520,8 @@ static NSDictionary* nsmapping = nil;
|
||||||
{
|
{
|
||||||
if (_color != aColor)
|
if (_color != aColor)
|
||||||
{
|
{
|
||||||
[_color release];
|
if (_color)
|
||||||
|
[_color release];
|
||||||
_color = [aColor retain];
|
_color = [aColor retain];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue