Skip to content

Commit

Permalink
mac: cefclient: Fix zombie NSWindow object on exit (fixes #3602)
Browse files Browse the repository at this point in the history
- Don't create a TempWindow when using Views.
- Don't call `close` on an NSWindow that is never opened.
  • Loading branch information
magreenblatt committed Jul 15, 2024
1 parent 02ea88f commit 8f4a474
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions tests/cefclient/browser/root_window_manager.cc
Original file line number Diff line number Diff line change
Expand Up @@ -141,8 +141,9 @@ scoped_refptr<RootWindow> RootWindowManager::CreateRootWindowAsPopup(

SanityCheckWindowConfig(is_devtools, use_views, use_alloy_style, with_osr);

if (!temp_window_) {
// TempWindow must be created on the UI thread.
if (!temp_window_ && !use_views) {
// TempWindow must be created on the UI thread. It is only used with
// native (non-Views) parent windows.
temp_window_.reset(new TempWindow());
}

Expand Down
2 changes: 1 addition & 1 deletion tests/cefclient/browser/temp_window_mac.mm
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
}
~TempWindowMacImpl() {
DCHECK(window_);
[window_ close];
window_ = nil;
}

private:
Expand Down

0 comments on commit 8f4a474

Please sign in to comment.