Be morte parimonious with resources.

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@26084 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Richard Frith-MacDonald 2008-02-18 07:23:47 +00:00
parent 206dc64723
commit 0b6c65c4cc
2 changed files with 11 additions and 6 deletions

View file

@ -3,6 +3,9 @@
* Source/NSDistributedNotificationCenter.m: Remove delay and change
code to immediately release resources used while trying to conneect
to server.
* Source/NSConnection.m: When creating a connection and getting its
proxy, release the connection immediately if the proxy is nil, so
that repeated calls don't use more resources.
2008-02-17 19:21-EST Gregory John Casamento <greg_casamento@yahoo.com>

View file

@ -586,16 +586,17 @@ static NSLock *cached_proxies_gate = nil;
+ (NSDistantObject*) rootProxyForConnectionWithRegisteredName: (NSString*)n
host: (NSString*)h
{
CREATE_AUTORELEASE_POOL(arp);
NSConnection *connection;
NSDistantObject *proxy = nil;
connection = [self connectionWithRegisteredName: n host: h];
if (connection != nil)
{
proxy = [connection rootProxy];
proxy = RETAIN([connection rootProxy]);
}
return proxy;
RELEASE(arp);
return AUTORELEASE(proxy);
}
/**
@ -611,6 +612,7 @@ static NSLock *cached_proxies_gate = nil;
+ (NSDistantObject*) rootProxyForConnectionWithRegisteredName: (NSString*)n
host: (NSString*)h usingNameServer: (NSPortNameServer*)s
{
CREATE_AUTORELEASE_POOL(arp);
NSConnection *connection;
NSDistantObject *proxy = nil;
@ -619,10 +621,10 @@ static NSLock *cached_proxies_gate = nil;
usingNameServer: s];
if (connection != nil)
{
proxy = [connection rootProxy];
proxy = RETAIN([connection rootProxy]);
}
return proxy;
RELEASE(arp);
return AUTORELEASE(proxy);
}
+ (void) _timeout: (NSTimer*)t