1
0
Fork 0
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:
attila 2024-07-13 19:56:30 +02:00
parent b35688d9a4
commit ae23783f63

View file

@ -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