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 release];
|
||||||
myWindow = [aWindow retain];
|
myWindow = [aWindow retain];
|
||||||
|
|
||||||
// Set the new observers
|
if (myWindow) {
|
||||||
// We want to know when our window got the focus
|
// Set the new observers
|
||||||
[nc addObserver:self
|
// We want to know when our window got the focus
|
||||||
selector:@selector(windowDidBecomeMain:)
|
[nc addObserver:self
|
||||||
name:NSWindowDidBecomeMainNotification
|
selector:@selector(windowDidBecomeMain:)
|
||||||
object:[self window]];
|
name:NSWindowDidBecomeMainNotification
|
||||||
|
object:[self window]];
|
||||||
// We want to know when our window lost the focus
|
|
||||||
[nc addObserver:self
|
// We want to know when our window lost the focus
|
||||||
selector:@selector(windowDidResignMain:)
|
[nc addObserver:self
|
||||||
name:NSWindowDidResignMainNotification
|
selector:@selector(windowDidResignMain:)
|
||||||
object:[self window]];
|
name:NSWindowDidResignMainNotification
|
||||||
|
object:[self window]];
|
||||||
// We want to know when the user closes the window
|
|
||||||
[nc addObserver:self
|
// We want to know when the user closes the window
|
||||||
selector:@selector(windowWillClose:)
|
[nc addObserver:self
|
||||||
name:NSWindowWillCloseNotification
|
selector:@selector(windowWillClose:)
|
||||||
object:[self window]];
|
name:NSWindowWillCloseNotification
|
||||||
|
object:[self window]];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue