From 549f07fd28a2f513992ee588346beaa58cb01b61 Mon Sep 17 00:00:00 2001 From: kappaOne Date: Thu, 31 Jan 2013 23:47:50 +0000 Subject: [PATCH] Release NSView object on Display.destroy() --- src/native/macosx/org_lwjgl_opengl_Display.m | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/native/macosx/org_lwjgl_opengl_Display.m b/src/native/macosx/org_lwjgl_opengl_Display.m index 308571d8..76fdd237 100644 --- a/src/native/macosx/org_lwjgl_opengl_Display.m +++ b/src/native/macosx/org_lwjgl_opengl_Display.m @@ -565,10 +565,9 @@ JNIEXPORT void JNICALL Java_org_lwjgl_opengl_MacOSXDisplay_nDestroyWindow(JNIEnv if ([window_info->window contentView] == window_info->view) { [window_info->window close]; } - else { - // the nsview has a parent, remove it from there - [window_info->view removeFromSuperviewWithoutNeedingDisplay]; - } + + // release the nsview and remove it from any parent nsview + [window_info->view removeFromSuperviewWithoutNeedingDisplay]; } }