Fixed NSException raised when using Cocoa windows after the SFML window has been closed.

git-svn-id: https://sfml.svn.sourceforge.net/svnroot/sfml/trunk@1482 4e206d99-4929-0410-ac5d-dfc041789085
This commit is contained in:
ceylo 2010-04-04 18:30:46 +00:00
parent 93ef2bf08a
commit 6d7b97c7a0

View file

@ -549,25 +549,26 @@
[myWindow release];
myWindow = [aWindow retain];
// Set the new observers
// We want to know when our window got the focus
[nc addObserver:self
selector:@selector(windowDidBecomeMain:)
name:NSWindowDidBecomeMainNotification
object:[self window]];
// We want to know when our window lost the focus
[nc addObserver:self
selector:@selector(windowDidResignMain:)
name:NSWindowDidResignMainNotification
object:[self window]];
// We want to know when the user closes the window
[nc addObserver:self
selector:@selector(windowWillClose:)
name:NSWindowWillCloseNotification
object:[self window]];
if (myWindow) {
// Set the new observers
// We want to know when our window got the focus
[nc addObserver:self
selector:@selector(windowDidBecomeMain:)
name:NSWindowDidBecomeMainNotification
object:[self window]];
// We want to know when our window lost the focus
[nc addObserver:self
selector:@selector(windowDidResignMain:)
name:NSWindowDidResignMainNotification
object:[self window]];
// We want to know when the user closes the window
[nc addObserver:self
selector:@selector(windowWillClose:)
name:NSWindowWillCloseNotification
object:[self window]];
}
}
}