From 77c9baab3556f351806378ab294967bb0999a788 Mon Sep 17 00:00:00 2001 From: Camilla Berglund Date: Mon, 26 Mar 2012 15:29:01 +0200 Subject: [PATCH] Fixed issues found with static analysis. --- src/cocoa_platform.h | 1 + src/cocoa_window.m | 8 ++++++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/cocoa_platform.h b/src/cocoa_platform.h index 801b4c88..67154190 100644 --- a/src/cocoa_platform.h +++ b/src/cocoa_platform.h @@ -74,6 +74,7 @@ typedef struct _GLFWwindowNS { id object; id delegate; + id view; unsigned int modifierFlags; double fracScrollX; double fracScrollY; diff --git a/src/cocoa_window.m b/src/cocoa_window.m index 3f3dbc4a..e3b79706 100644 --- a/src/cocoa_window.m +++ b/src/cocoa_window.m @@ -687,9 +687,10 @@ static GLboolean createWindow(_GLFWwindow* window, return GL_FALSE; } + window->NS.view = [[GLFWContentView alloc] initWithGlfwWindow:window]; + [window->NS.object setTitle:[NSString stringWithUTF8String:wndconfig->title]]; - [window->NS.object setContentView:[[GLFWContentView alloc] - initWithGlfwWindow:window]]; + [window->NS.object setContentView:window->NS.view]; [window->NS.object setDelegate:window->NS.delegate]; [window->NS.object setAcceptsMouseMovedEvents:YES]; [window->NS.object center]; @@ -963,6 +964,9 @@ void _glfwPlatformCloseWindow(_GLFWwindow* window) [window->NS.delegate release]; window->NS.delegate = nil; + [window->NS.view release]; + window->NS.view = nil; + [window->NS.object close]; window->NS.object = nil;