From d85a2e283647c257e99a2b6aa7ca6e71f470f0ab Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Tue, 19 May 2009 10:45:57 +0000 Subject: [PATCH] From Stephan Huber, "when using windownames and switching between fullscreen and windowed mode GraphicsWindowCocoa crashes. Attached you'll find a fix for that bug. " --- src/osgViewer/GraphicsWindowCocoa.mm | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/osgViewer/GraphicsWindowCocoa.mm b/src/osgViewer/GraphicsWindowCocoa.mm index 14a634966..41dea46eb 100755 --- a/src/osgViewer/GraphicsWindowCocoa.mm +++ b/src/osgViewer/GraphicsWindowCocoa.mm @@ -1150,7 +1150,8 @@ bool GraphicsWindowCocoa::setWindowDecorationImplementation(bool flag) if (new_win) { [new_win setContentView: [_window contentView]]; setupNSWindow(new_win); - [new_win setTitle: [_window title]]; + NSString* title = (_traits.valid()) ? [NSString stringWithUTF8String: _traits->windowName.c_str()] : @""; + [new_win setTitle: title ]; [_window close]; [_window release]; @@ -1272,9 +1273,8 @@ void GraphicsWindowCocoa::setWindowName (const std::string & name) NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; - NSString* title = [NSString stringWithCString: name.c_str() encoding: NSUTF8StringEncoding]; + NSString* title = [NSString stringWithUTF8String: name.c_str()]; [_window setTitle: title]; - [title release]; [pool release]; }