mirror of
https://github.com/juce-framework/JUCE.git
synced 2026-01-10 23:44:24 +00:00
Windows: Fix rare crash when creating and destroying WebBrowserComponent instances
This commit is contained in:
parent
b35688d9a4
commit
ae23783f63
1 changed files with 6 additions and 2 deletions
|
|
@ -519,6 +519,12 @@ public:
|
|||
|
||||
~WebView2() override
|
||||
{
|
||||
if (webView2ConstructionHelper.webView2BeingCreated == this)
|
||||
webView2ConstructionHelper.webView2BeingCreated = nullptr;
|
||||
|
||||
webView2ConstructionHelper.viewsWaitingForCreation.erase (this);
|
||||
|
||||
cancelPendingUpdate();
|
||||
removeEventHandlers();
|
||||
closeWebView();
|
||||
}
|
||||
|
|
@ -1022,8 +1028,6 @@ private:
|
|||
webView2ConstructionHelper.viewsWaitingForCreation.erase (this);
|
||||
webView2ConstructionHelper.webView2BeingCreated = this;
|
||||
|
||||
WeakReference<WebView2> weakThis (this);
|
||||
|
||||
webViewHandle.environment->CreateCoreWebView2Controller ((HWND) peer->getNativeHandle(),
|
||||
Callback<ICoreWebView2CreateCoreWebView2ControllerCompletedHandler> (
|
||||
[weakThis = WeakReference<WebView2> { this }] (HRESULT, ICoreWebView2Controller* controller) -> HRESULT
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue