From 69cd33395ad166f54a8bdb87785e5e49f4285dbb Mon Sep 17 00:00:00 2001 From: Tomas Rycl Date: Mon, 9 Oct 2017 13:33:30 +0000 Subject: [PATCH] Fixed crash on startup on Windows --- atom/browser/common_web_contents_delegate.cc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/atom/browser/common_web_contents_delegate.cc b/atom/browser/common_web_contents_delegate.cc index 049b6dcf7a0..98a90efd6e5 100644 --- a/atom/browser/common_web_contents_delegate.cc +++ b/atom/browser/common_web_contents_delegate.cc @@ -181,10 +181,11 @@ void CommonWebContentsDelegate::SetOwnerWindow( content::WebContents* web_contents, NativeWindow* owner_window) { owner_window_ = owner_window ? owner_window->GetWeakPtr() : nullptr; auto relay = base::MakeUnique(owner_window_); + auto relay_key = relay->key; if (owner_window) { - web_contents->SetUserData(relay->key, std::move(relay)); + web_contents->SetUserData(relay_key, std::move(relay)); } else { - web_contents->RemoveUserData(relay->key); + web_contents->RemoveUserData(relay_key); relay.reset(); } }