fix: crash on browserView.webContents.destroy() (#31794)
This commit is contained in:
parent
22f863b37a
commit
7e328c4b87
2 changed files with 11 additions and 3 deletions
|
@ -983,8 +983,7 @@ void WebContents::DeleteThisIfAlive() {
|
|||
void WebContents::Destroy() {
|
||||
// The content::WebContents should be destroyed asyncronously when possible
|
||||
// as user may choose to destroy WebContents during an event of it.
|
||||
if (Browser::Get()->is_shutting_down() || IsGuest() ||
|
||||
type_ == Type::kBrowserView) {
|
||||
if (Browser::Get()->is_shutting_down() || IsGuest()) {
|
||||
DeleteThisIfAlive();
|
||||
} else {
|
||||
base::PostTask(FROM_HERE, {content::BrowserThread::UI},
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue