mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-04-06 00:32:05 +02:00
Fix macOS WebView script-handler cleanup after wxWidgets 3.3 upgrade
Commit ed88cbe removed `new WebViewWebKit` on macOS because wx 3.3
dropped the no-arg wxWebViewWebKit constructor, falling through to
wxWebView::New(). That bypassed the WebViewWebKit destructor that calls
RemoveScriptMessageHandler("wx"), reintroducing the WebKit teardown bug
the subclass was added to fix.
Restore the macOS-specific subclass path by adding a constructor that
forwards to the wx 3.3 wxWebViewConfiguration-based ctor.
This commit is contained in:
@@ -173,6 +173,12 @@ private:
|
||||
|
||||
class WebViewWebKit : public wxWebViewWebKit
|
||||
{
|
||||
public:
|
||||
WebViewWebKit()
|
||||
: wxWebViewWebKit(wxWebView::NewConfiguration(wxWebViewBackendWebKit))
|
||||
{
|
||||
}
|
||||
|
||||
~WebViewWebKit() override
|
||||
{
|
||||
RemoveScriptMessageHandler("wx");
|
||||
@@ -257,6 +263,8 @@ wxWebView* WebView::CreateWebView(wxWindow * parent, wxString const & url)
|
||||
|
||||
#ifdef __WIN32__
|
||||
wxWebView* webView = new WebViewEdge;
|
||||
#elif defined(__WXOSX__)
|
||||
wxWebView* webView = new WebViewWebKit;
|
||||
#else
|
||||
auto webView = wxWebView::New();
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user