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:
parent
93ef2bf08a
commit
6d7b97c7a0
|
@ -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]];
|
||||
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]];
|
||||
// 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]];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue