Changeset 5498

Show
Ignore:
Timestamp:
05/06/08 16:07:04 (1 week ago)
Author:
morris
Message:

Make sure we're removing ourselves when the right window closed

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • WiredClient/trunk/WCConnectionController.m

    r4819 r5498  
    9595 
    9696- (void)_WC_windowWillClose:(NSNotification *)notification { 
    97         if([self isReleasedWhenClosed]) { 
     97        if([self isReleasedWhenClosed] && [notification object] == [self window]) { 
    9898                [self _saveWindowTemplate]; 
    9999                 
     
    216216 
    217217- (void)dealloc { 
     218        [[NSNotificationCenter defaultCenter] removeObserver:self]; 
     219         
    218220        [_name release]; 
    219221        [_identifier release]; 
     
    235237                addObserver:self 
    236238                   selector:@selector(_WC_windowWillClose:) 
    237                            name:NSWindowWillCloseNotification 
    238                          object:[self window]]; 
     239                           name:NSWindowWillCloseNotification]; 
    239240} 
    240241