mirror of
https://github.com/cefsharp/CefSharp.git
synced 2026-12-06 04:00:07 +00:00
Fixed NullReferenceException in DoClose (#1980)
* Fixed NullReferenceException in DoClose
This commit is contained in:
@@ -200,9 +200,12 @@ namespace CefSharp
|
||||
|
||||
if (handler != nullptr)
|
||||
{
|
||||
auto browserWrapper = GetBrowserWrapper(browser->GetIdentifier(), browser->IsPopup());
|
||||
|
||||
return handler->DoClose(_browserControl, browserWrapper);
|
||||
//By this point it's possible IBrowser references have been disposed
|
||||
//Rather than attempting to rework the rather complex closing logic
|
||||
//It's easier to pass in a new wrapper and dispose it straight away
|
||||
CefSharpBrowserWrapper browserWrapper(browser);
|
||||
|
||||
return handler->DoClose(_browserControl, %browserWrapper);
|
||||
}
|
||||
|
||||
return false;
|
||||
|
||||
Reference in New Issue
Block a user