mirror of
https://github.com/gnustep/libs-base.git
synced 2025-05-30 08:21:25 +00:00
Updates for revised NSNotificationCenter
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@4416 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
a9c28e8013
commit
eda1ff3d60
6 changed files with 62 additions and 43 deletions
|
@ -466,7 +466,7 @@ static int messages_received_count;
|
|||
/*
|
||||
* Don't need notifications any more - so remove self as observer.
|
||||
*/
|
||||
[NSNotificationCenter removeObserver: self];
|
||||
[[NSNotificationCenter defaultCenter] removeObserver: self];
|
||||
|
||||
/*
|
||||
* We can't be the ancestor of anything if we are invalid.
|
||||
|
@ -511,8 +511,9 @@ static int messages_received_count;
|
|||
{
|
||||
NSAutoreleasePool *arp = [NSAutoreleasePool new];
|
||||
|
||||
[NSNotificationCenter postNotificationName: NSConnectionDidDieNotification
|
||||
object: self];
|
||||
[[NSNotificationCenter defaultCenter]
|
||||
postNotificationName: NSConnectionDidDieNotification
|
||||
object: self];
|
||||
[arp release];
|
||||
}
|
||||
}
|
||||
|
@ -1056,7 +1057,7 @@ static int messages_received_count;
|
|||
NSHashInsert(connection_table, (void*)newConn);
|
||||
[connection_table_gate unlock];
|
||||
|
||||
[NSNotificationCenter
|
||||
[[NSNotificationCenter defaultCenter]
|
||||
postNotificationName: NSConnectionDidInitializeNotification
|
||||
object: newConn];
|
||||
|
||||
|
|
|
@ -325,11 +325,11 @@ static NSDistributedNotificationCenter *defCenter = nil;
|
|||
/*
|
||||
* Ask to be told if the copnnection goes away.
|
||||
*/
|
||||
[NSNotificationCenter
|
||||
addObserver: self
|
||||
selector: @selector(_invalidated:)
|
||||
name: NSConnectionDidDieNotification
|
||||
object: c];
|
||||
[[NSNotificationCenter defaultCenter]
|
||||
addObserver: self
|
||||
selector: @selector(_invalidated:)
|
||||
name: NSConnectionDidDieNotification
|
||||
object: c];
|
||||
[remote registerClient: (id<GDNCClient>)self];
|
||||
}
|
||||
else
|
||||
|
@ -376,9 +376,10 @@ NSLog(@"Connection to GDNC server established.\n");
|
|||
/*
|
||||
* Tidy up now that the connection has gone away.
|
||||
*/
|
||||
[NSNotificationCenter removeObserver: self
|
||||
name: NSConnectionDidDieNotification
|
||||
object: connection];
|
||||
[[NSNotificationCenter defaultCenter]
|
||||
removeObserver: self
|
||||
name: NSConnectionDidDieNotification
|
||||
object: connection];
|
||||
NSAssert(connection == [remote connectionForProxy],
|
||||
NSInternalInconsistencyException);
|
||||
[remote release];
|
||||
|
|
|
@ -88,8 +88,9 @@ NSString *NSPortTimeoutException
|
|||
{
|
||||
[[NSPortNameServer defaultPortNameServer] removePort: self];
|
||||
is_valid = NO;
|
||||
[NSNotificationCenter postNotificationName: NSPortDidBecomeInvalidNotification
|
||||
object: self];
|
||||
[[NSNotificationCenter defaultCenter]
|
||||
postNotificationName: NSPortDidBecomeInvalidNotification
|
||||
object: self];
|
||||
}
|
||||
|
||||
- (BOOL) isValid
|
||||
|
|
|
@ -687,15 +687,17 @@ static NSPortNameServer *defaultServer = nil;
|
|||
{
|
||||
if (handle)
|
||||
{
|
||||
[NSNotificationCenter removeObserver: self
|
||||
name: GSFileHandleConnectCompletionNotification
|
||||
object: handle];
|
||||
[NSNotificationCenter removeObserver: self
|
||||
name: NSFileHandleReadCompletionNotification
|
||||
object: handle];
|
||||
[NSNotificationCenter removeObserver: self
|
||||
name: GSFileHandleWriteCompletionNotification
|
||||
object: handle];
|
||||
NSNotificationCenter *nc = [NSNotificationCenter defaultCenter];
|
||||
|
||||
[nc removeObserver: self
|
||||
name: GSFileHandleConnectCompletionNotification
|
||||
object: handle];
|
||||
[nc removeObserver: self
|
||||
name: NSFileHandleReadCompletionNotification
|
||||
object: handle];
|
||||
[nc removeObserver: self
|
||||
name: GSFileHandleWriteCompletionNotification
|
||||
object: handle];
|
||||
[handle closeFile];
|
||||
[handle release];
|
||||
handle = nil;
|
||||
|
@ -721,9 +723,10 @@ static NSPortNameServer *defaultServer = nil;
|
|||
* stop watching for connection completion.
|
||||
*/
|
||||
expecting = 0;
|
||||
[NSNotificationCenter removeObserver: self
|
||||
name: GSFileHandleConnectCompletionNotification
|
||||
object: handle];
|
||||
[[NSNotificationCenter defaultCenter]
|
||||
removeObserver: self
|
||||
name: GSFileHandleConnectCompletionNotification
|
||||
object: handle];
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue