Extra AlloyBrowserHostImpl::DestroyBrowser nullptr checks

Do not post support requests, bug reports or feature requests. Discuss CEF here. Non-CEF related discussion goes in General Discussion!

Extra AlloyBrowserHostImpl::DestroyBrowser nullptr checks

Postby amaitland » Sat Jan 27, 2024 3:39 pm

In `AlloyBrowserHostImpl::DestroyBrowser` a user is reporting that `platform_delegate_` is a nullptr. Looks like it's fairly reproducible.

Call stack at https://github.com/cefsharp/CefSharp/is ... 1873906342

Basically `CefBrowserHost:CloseBrowser(true)` is being called within `DoClose`. I can modify the example code to avoid making this call, it's difficult to stop the user from doing this though. I might be able to hack around it. I can go into more technical detail as to the reason this happens if it's relevant, I know this is light on details.

My question is, would adding a null ptr check to AlloyBrowserHostImpl::DestroyBrowser be acceptable? There are lots of other places in AlloyBrowserHostImpl that have checks.

Code: Select all
if (platform_delegate_) {
    platform_delegate_->BrowserDestroyed(this);
  }


Or some other check?
Maintainer of the CefSharp project.
amaitland
Virtuoso
 
Posts: 1292
Joined: Wed Jan 14, 2015 2:35 am

Re: Extra AlloyBrowserHostImpl::DestroyBrowser nullptr check

Postby magreenblatt » Sat Jan 27, 2024 4:14 pm

What is the call stack for the crash?

EDIT: Never mind, I see it in the CefSharp issue.
magreenblatt
Site Admin
 
Posts: 12409
Joined: Fri May 29, 2009 6:57 pm

Re: Extra AlloyBrowserHostImpl::DestroyBrowser nullptr check

Postby magreenblatt » Sat Jan 27, 2024 4:18 pm

These shutdown ordering issues can be tricky. I’ll look at it properly this week and get back to you.
magreenblatt
Site Admin
 
Posts: 12409
Joined: Fri May 29, 2009 6:57 pm

Re: Extra AlloyBrowserHostImpl::DestroyBrowser nullptr check

Postby amaitland » Sat Jan 27, 2024 4:35 pm

Thanks for the amazingly fast response!
Maintainer of the CefSharp project.
amaitland
Virtuoso
 
Posts: 1292
Joined: Wed Jan 14, 2015 2:35 am


Return to CEF Discussion

Who is online

Users browsing this forum: No registered users and 143 guests