mac: cefclient: Fix zombie NSWindow object on exit (fixes #3602)

- Don't create a TempWindow when using Views.
- Don't call `close` on an NSWindow that is never opened.
This commit is contained in:
Marshall Greenblatt 2024-07-15 16:42:19 -04:00
parent 02ea88f79f
commit 8f4a47479c
2 changed files with 4 additions and 3 deletions

View File

@ -141,8 +141,9 @@ scoped_refptr<RootWindow> RootWindowManager::CreateRootWindowAsPopup(
SanityCheckWindowConfig(is_devtools, use_views, use_alloy_style, with_osr); SanityCheckWindowConfig(is_devtools, use_views, use_alloy_style, with_osr);
if (!temp_window_) { if (!temp_window_ && !use_views) {
// TempWindow must be created on the UI thread. // TempWindow must be created on the UI thread. It is only used with
// native (non-Views) parent windows.
temp_window_.reset(new TempWindow()); temp_window_.reset(new TempWindow());
} }

View File

@ -29,7 +29,7 @@ class TempWindowMacImpl {
} }
~TempWindowMacImpl() { ~TempWindowMacImpl() {
DCHECK(window_); DCHECK(window_);
[window_ close]; window_ = nil;
} }
private: private: