mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-05-18 11:02:08 +00: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
|
class WebViewWebKit : public wxWebViewWebKit
|
||||||
{
|
{
|
||||||
|
public:
|
||||||
|
WebViewWebKit()
|
||||||
|
: wxWebViewWebKit(wxWebView::NewConfiguration(wxWebViewBackendWebKit))
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
~WebViewWebKit() override
|
~WebViewWebKit() override
|
||||||
{
|
{
|
||||||
RemoveScriptMessageHandler("wx");
|
RemoveScriptMessageHandler("wx");
|
||||||
@@ -257,6 +263,8 @@ wxWebView* WebView::CreateWebView(wxWindow * parent, wxString const & url)
|
|||||||
|
|
||||||
#ifdef __WIN32__
|
#ifdef __WIN32__
|
||||||
wxWebView* webView = new WebViewEdge;
|
wxWebView* webView = new WebViewEdge;
|
||||||
|
#elif defined(__WXOSX__)
|
||||||
|
wxWebView* webView = new WebViewWebKit;
|
||||||
#else
|
#else
|
||||||
auto webView = wxWebView::New();
|
auto webView = wxWebView::New();
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
Reference in New Issue
Block a user