Minor fix

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@17337 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
CaS 2003-07-25 13:58:25 +00:00
parent 778c3a3c7c
commit b3695601ed
2 changed files with 5 additions and 2 deletions

View file

@ -8,6 +8,7 @@
* Source/NSConnection.m: Fix thread related memory leak leaving * Source/NSConnection.m: Fix thread related memory leak leaving
an NSRunLoop in a connection when the connection is no longer an NSRunLoop in a connection when the connection is no longer
using it. using it.
* Source/NSURL.m: retain handle while doing background load.
2003-07-23 Richard Frith-Macdonald <rfm@gnu.org> 2003-07-23 Richard Frith-Macdonald <rfm@gnu.org>

View file

@ -1138,7 +1138,7 @@ static unsigned urlAlign;
[clientsLock lock]; [clientsLock lock];
if (_clients == 0) if (_clients == 0)
{ {
_clients = NSCreateMapTable (NSNonRetainedObjectMapKeyCallBacks, _clients = NSCreateMapTable (NSObjectMapKeyCallBacks,
NSNonRetainedObjectMapValueCallBacks, 0); NSNonRetainedObjectMapValueCallBacks, 0);
} }
NSMapInsert((NSMapTable*)_clients, (void*)handle, (void*)client); NSMapInsert((NSMapTable*)_clients, (void*)handle, (void*)client);
@ -1566,6 +1566,8 @@ static unsigned urlAlign;
{ {
id c = clientForHandle(_clients, sender); id c = clientForHandle(_clients, sender);
RETAIN(self);
[sender removeClient: self];
if (c != nil) if (c != nil)
{ {
if ([c respondsToSelector: @selector(URLResourceDidFinishLoading:)]) if ([c respondsToSelector: @selector(URLResourceDidFinishLoading:)])
@ -1576,7 +1578,7 @@ static unsigned urlAlign;
NSMapRemove((NSMapTable*)_clients, (void*)sender); NSMapRemove((NSMapTable*)_clients, (void*)sender);
[clientsLock unlock]; [clientsLock unlock];
} }
[sender removeClient: self]; RELEASE(self);
} }
@end @end