cefclient: Fix invalid cast to ClientHandlerStd (see #3499)

This commit is contained in:
Marshall Greenblatt
2024-08-05 18:30:39 -04:00
parent f6f4ba8317
commit 166eec85e0
13 changed files with 95 additions and 7 deletions

View File

@@ -947,8 +947,10 @@ void OsrWindowWin::OnAfterCreated(CefRefPtr<CefBrowser> browser) {
void OsrWindowWin::OnBeforeClose(CefRefPtr<CefBrowser> browser) {
CEF_REQUIRE_UI_THREAD();
// Detach |this| from the ClientHandlerOsr.
static_cast<ClientHandlerOsr*>(browser_->GetHost()->GetClient().get())
->DetachOsrDelegate();
auto handler =
ClientHandlerOsr::GetForClient(browser_->GetHost()->GetClient());
CHECK(handler);
handler->DetachOsrDelegate();
browser_ = nullptr;
render_handler_->SetBrowser(nullptr);
Destroy();