Correction to handleNotification in GormDocument. Prevents a random crash when using "test interface".

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/apps/gorm/trunk@19282 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Gregory John Casamento 2004-05-11 01:42:50 +00:00
parent 37fa0eb3d8
commit 4b58c2c8c1
2 changed files with 10 additions and 1 deletions

View file

@ -1,3 +1,11 @@
2004-05-10 21:45 Gregory John Casamento <greg_casamento@yahoo.com>
* GormDocument.m: [GormDocument handleNotification:] was failing
to remove the document as an observer in the notification center.
This was causing the old document to be retained and was, also causing
"Test Interface" to fail randomly because the notifcation cetner
was still attempting to reach the old document.
2004-05-10 11:58 Gregory John Casamento <greg_casamento@yahoo.com>
* Gorm.m: Update version to 0.7.7 (Alpha) to avoid confusion between

View file

@ -1483,10 +1483,10 @@ static NSImage *classesImage = nil;
- (void) handleNotification: (NSNotification*)aNotification
{
NSString *name = [aNotification name];
NSNotificationCenter *nc = [NSNotificationCenter defaultCenter];
if ([name isEqual: NSWindowWillCloseNotification] == YES)
{
NSNotificationCenter *nc = [NSNotificationCenter defaultCenter];
NSEnumerator *enumerator;
id obj;
@ -1516,6 +1516,7 @@ static NSImage *classesImage = nil;
[self setDocumentActive: NO];
[self setSelectionFromEditor: nil];
[nc removeObserver: self]; // stop listening to all notifications.
}
else if ([name isEqual: NSWindowDidBecomeKeyNotification] == YES)
{