mirror of
https://github.com/gnustep/libs-base.git
synced 2025-05-30 16:30:41 +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
4126859bd5
commit
aa2e15e6f5
6 changed files with 62 additions and 43 deletions
38
Tools/gdnc.m
38
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)
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue