Commit 10ef43ce by Le Hoang Quyen Committed by Commit Bot

Fix end2end intermittent crash on macOS if custom OSWindow is used.

In MultisammpleTest, a custom OSWindow object is created. Sometimes this window's internal Objective-C window object is not released after the test finishes, thus input events such as mouse/keyboard are still forwarded to this window. However its content view is already released causing the crash. call [mWindow setContentView:nil] inside OSXWindow::destroy() seems to fix this bug. Bug: angleproject:4815 Change-Id: If00398ff0082624ade5e8be8ad3b0f91d17c23ed Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2281782 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: 's avatarShahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: 's avatarJonah Ryan-Davis <jonahr@google.com> Reviewed-by: 's avatarJamie Madill <jmadill@chromium.org>
parent b8583bcc
...@@ -685,6 +685,8 @@ void OSXWindow::destroy() ...@@ -685,6 +685,8 @@ void OSXWindow::destroy()
[mDelegate onOSXWindowDeleted]; [mDelegate onOSXWindowDeleted];
[mDelegate release]; [mDelegate release];
mDelegate = nil; mDelegate = nil;
// NSWindow won't be completely released unless its content view is set to nil:
[mWindow setContentView:nil];
[mWindow release]; [mWindow release];
mWindow = nil; mWindow = nil;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment