mirror of
https://bitbucket.org/chromiumembedded/cef
synced 2025-06-05 21:39:12 +02:00
Fix crash if a frame is detached before the attach message arrives (see issue #2421)
This reproduced on Mac with ResourceRequestHandlerTest.BasicStandardUnhandledModifyBeforeResourceLoad
This commit is contained in:
@ -559,6 +559,12 @@ void CefFrameHostImpl::SendMessage(const std::string& name,
|
||||
void CefFrameHostImpl::FrameAttached() {
|
||||
CEF_REQUIRE_UIT();
|
||||
|
||||
auto browser_info = GetBrowserInfo();
|
||||
if (!browser_info) {
|
||||
// Already Detached.
|
||||
return;
|
||||
}
|
||||
|
||||
DCHECK(!is_attached_);
|
||||
if (!is_attached_) {
|
||||
is_attached_ = true;
|
||||
@ -571,7 +577,7 @@ void CefFrameHostImpl::FrameAttached() {
|
||||
queued_actions_.pop();
|
||||
}
|
||||
|
||||
GetBrowserInfo()->MaybeExecuteFrameNotification(base::BindOnce(
|
||||
browser_info->MaybeExecuteFrameNotification(base::BindOnce(
|
||||
[](CefRefPtr<CefFrameHostImpl> self,
|
||||
CefRefPtr<CefFrameHandler> handler) {
|
||||
if (auto browser = self->GetBrowserHostBase()) {
|
||||
|
Reference in New Issue
Block a user