Fixed crash on startup on Windows
This commit is contained in:
parent
fe9ae41f98
commit
69cd33395a
1 changed files with 3 additions and 2 deletions
|
@ -181,10 +181,11 @@ void CommonWebContentsDelegate::SetOwnerWindow(
|
||||||
content::WebContents* web_contents, NativeWindow* owner_window) {
|
content::WebContents* web_contents, NativeWindow* owner_window) {
|
||||||
owner_window_ = owner_window ? owner_window->GetWeakPtr() : nullptr;
|
owner_window_ = owner_window ? owner_window->GetWeakPtr() : nullptr;
|
||||||
auto relay = base::MakeUnique<NativeWindowRelay>(owner_window_);
|
auto relay = base::MakeUnique<NativeWindowRelay>(owner_window_);
|
||||||
|
auto relay_key = relay->key;
|
||||||
if (owner_window) {
|
if (owner_window) {
|
||||||
web_contents->SetUserData(relay->key, std::move(relay));
|
web_contents->SetUserData(relay_key, std::move(relay));
|
||||||
} else {
|
} else {
|
||||||
web_contents->RemoveUserData(relay->key);
|
web_contents->RemoveUserData(relay_key);
|
||||||
relay.reset();
|
relay.reset();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue