OSX/Mouse::GetPosition(relativeTo) no longer complains when the window is closed

This commit is contained in:
Marco Antognini 2011-07-14 09:59:20 +02:00
parent 535733f5c7
commit c3e64230cb

View File

@ -61,6 +61,7 @@ SFOpenGLView* GetSFOpenGLViewFromSFMLWindow(const Window& window)
// Get our SFOpenGLView from ... // Get our SFOpenGLView from ...
SFOpenGLView* view = nil; SFOpenGLView* view = nil;
if ([nsHandle isKindOfClass:[NSWindow class]]) { if ([nsHandle isKindOfClass:[NSWindow class]]) {
// If system handle is a window then from its content view. // If system handle is a window then from its content view.
view = [nsHandle contentView]; view = [nsHandle contentView];
@ -89,10 +90,13 @@ SFOpenGLView* GetSFOpenGLViewFromSFMLWindow(const Window& window)
} }
} else { } else {
if (nsHandle != 0) {
sf::Err() << "The system handle is neither a <NSWindow*> nor <NSView*>" sf::Err() << "The system handle is neither a <NSWindow*> nor <NSView*>"
<< "object. This shouldn't happen." << "object. This shouldn't happen."
<< std::endl; << std::endl;
} else {
// This probably means the SFML window was previously closed.
}
} }