From f929914432809706d239cdd66ea1cd5ba11eaef4 Mon Sep 17 00:00:00 2001 From: Alex Maitland Date: Tue, 9 Feb 2021 21:05:49 +1000 Subject: [PATCH] Core - ManagedCefBrowserAdapter::CreateBrowser add missing UnWrap call Add UnWrap call to allow for passing in CefSharp.WindowInfo (the wrapper object) Resolves #3399 --- CefSharp.Core.Runtime/ManagedCefBrowserAdapter.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/CefSharp.Core.Runtime/ManagedCefBrowserAdapter.cpp b/CefSharp.Core.Runtime/ManagedCefBrowserAdapter.cpp index 39edc4659..545ece401 100644 --- a/CefSharp.Core.Runtime/ManagedCefBrowserAdapter.cpp +++ b/CefSharp.Core.Runtime/ManagedCefBrowserAdapter.cpp @@ -27,8 +27,6 @@ namespace CefSharp void ManagedCefBrowserAdapter::CreateBrowser(IWindowInfo^ windowInfo, IBrowserSettings^ browserSettings, IRequestContext^ requestContext, String^ address) { - auto cefWindowInfoWrapper = static_cast(windowInfo); - CefString addressNative = StringUtils::ToNative(address); if (browserSettings == nullptr) @@ -90,10 +88,11 @@ namespace CefSharp auto managedRequestCtx = (RequestContext^)requestContext->UnWrap(); requestCtx = static_cast>(managedRequestCtx); } - + + auto winInfo = (WindowInfo^)windowInfo->UnWrap(); auto bSettings = (BrowserSettings^)browserSettings->UnWrap(); - if (!CefBrowserHost::CreateBrowser(*cefWindowInfoWrapper->GetWindowInfo(), _clientAdapter.get(), addressNative, + if (!CefBrowserHost::CreateBrowser(*winInfo->GetWindowInfo(), _clientAdapter.get(), addressNative, *bSettings->_browserSettings, extraInfo, requestCtx)) { throw gcnew InvalidOperationException("CefBrowserHost::CreateBrowser call failed, review the CEF log file for more details.");