Fix crash opening some .blend files on OS X 10.8 with double click or drag and

drop onto the application.

It seems something changed in the operating which makes our method of releasing
windows crash. Previously we called [m_window release], but on 10.8 this does
not remove the window from [NSApp orderedWindows] and perhaps other places,
leading to crashes. So instead we set setReleasedWhenClosed back to YES right
before closing, which will then do the cleanup for us.
This commit is contained in:
Brecht Van Lommel
2012-12-05 06:30:17 +00:00
parent 57d7c1f226
commit 690359eb8d

View File

@@ -609,9 +609,12 @@ GHOST_WindowCocoa::~GHOST_WindowCocoa()
[m_openGLView release];
if (m_window) {
// previously we called [m_window release], but on 10.8 this does not
// remove the window from [NSApp orderedWindows] and perhaps other
// places, leading to crashes. so instead we set setReleasedWhenClosed
// back to YES right before closing
[m_window setReleasedWhenClosed:YES];
[m_window close];
[[m_window delegate] release];
[m_window release];
m_window = nil;
}