diff --git a/ChangeLog b/ChangeLog index 6d8b3dcda..abd04a8d2 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +Thu Jun 17 12:00:00 1999 Richard Frith-Macdonald + + * Tools/gdnc.m: Only use OpenStep NSNotificationCenter methods. + * Source/NSConnection.m: ditto + * Source/NSDistributedNotificationCenter.m: ditto + * Source/NSPort.m: ditto + * Source/NSPortNameServer.m: ditto + * Source/NSSerializer.m: ditto + Mon Jun 14 10:20:00 1999 Richard Frith-Macdonald * Source/NSConcreteValue.m: Update for MacOS-X and for GC diff --git a/Source/NSConnection.m b/Source/NSConnection.m index 0ea48dea4..ec9eb5715 100644 --- a/Source/NSConnection.m +++ b/Source/NSConnection.m @@ -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]; diff --git a/Source/NSDistributedNotificationCenter.m b/Source/NSDistributedNotificationCenter.m index 93e761412..b22325bad 100644 --- a/Source/NSDistributedNotificationCenter.m +++ b/Source/NSDistributedNotificationCenter.m @@ -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)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]; diff --git a/Source/NSPort.m b/Source/NSPort.m index 8c027b3d7..ef8630602 100644 --- a/Source/NSPort.m +++ b/Source/NSPort.m @@ -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 diff --git a/Source/NSPortNameServer.m b/Source/NSPortNameServer.m index 92c8366a5..a02a604b0 100644 --- a/Source/NSPortNameServer.m +++ b/Source/NSPortNameServer.m @@ -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]; } } diff --git a/Tools/gdnc.m b/Tools/gdnc.m index 3c0410ac5..fa65417df 100644 --- a/Tools/gdnc.m +++ b/Tools/gdnc.m @@ -174,15 +174,16 @@ - (void) dealloc { + NSNotificationCenter *nc = [NSNotificationCenter defaultCenter]; NSMapEnumerator enumerator; NSConnection *connection; NSMapTable *clients; if (conn) { - [NSNotificationCenter removeObserver: self - name: NSConnectionDidDieNotification - object: conn]; + [nc removeObserver: self + name: NSConnectionDidDieNotification + object: conn]; [conn release]; conn = nil; } @@ -195,9 +196,9 @@ while (NSNextMapEnumeratorPair(&enumerator, (void**)&connection, (void**)&clients) == YES) { - [NSNotificationCenter removeObserver: self - name: NSConnectionDidDieNotification - object: connection]; + [nc removeObserver: self + name: NSConnectionDidDieNotification + object: connection]; [self removeObserversForClients: clients]; NSFreeMapTable(clients); } @@ -236,10 +237,11 @@ * Get notifications for new connections and connection losses. */ [conn setDelegate: self]; - [NSNotificationCenter addObserver: self - selector: @selector(connectionBecameInvalid:) - name: NSConnectionDidDieNotification - object: conn]; + [[NSNotificationCenter defaultCenter] + addObserver: self + selector: @selector(connectionBecameInvalid:) + name: NSConnectionDidDieNotification + object: conn]; return self; } @@ -341,10 +343,11 @@ { NSMapTable *table; - [NSNotificationCenter addObserver: self - selector: @selector(connectionBecameInvalid:) - name: NSConnectionDidDieNotification - object: newConn]; + [[NSNotificationCenter defaultCenter] + addObserver: self + selector: @selector(connectionBecameInvalid:) + name: NSConnectionDidDieNotification + object: newConn]; [newConn setDelegate: self]; /* * Create a new map table entry for this connection with a value that @@ -361,9 +364,10 @@ { id connection = [notification object]; - [NSNotificationCenter removeObserver: self - name: NSConnectionDidDieNotification - object: connection]; + [[NSNotificationCenter defaultCenter] + removeObserver: self + name: NSConnectionDidDieNotification + object: connection]; if (connection == conn) {