mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-19 04:37:52 -06:00
FIX: [STUDIO-1033] rm webview script handler on webview destory
Change-Id: If1465ba6bf997bf17b8a33bc33d0f20d34fcbdc7
This commit is contained in:
parent
db65fd6e83
commit
9f3a89320b
4 changed files with 14 additions and 10 deletions
|
@ -180,14 +180,18 @@ wxWebView* WebView::CreateWebView(wxWindow * parent, wxString const & url)
|
|||
Slic3r::GUI::WKWebView_setTransparentBackground(wkWebView);
|
||||
#endif
|
||||
#ifndef __WIN32__
|
||||
Slic3r::GUI::wxGetApp().CallAfter([webView] {
|
||||
webView->CallAfter([webView] {
|
||||
#endif
|
||||
BOOST_LOG_TRIVIAL(info) << __FUNCTION__ << ": begin to add script message handler for wx.";
|
||||
Slic3r::GUI::wxGetApp().set_adding_script_handler(true);
|
||||
webView->Bind(wxEVT_DESTROY, [webView] (auto & e) {
|
||||
webView->RemoveScriptMessageHandler("wx");
|
||||
});
|
||||
if (!webView->AddScriptMessageHandler("wx"))
|
||||
wxLogError("Could not add script message handler");
|
||||
Slic3r::GUI::wxGetApp().set_adding_script_handler(false);
|
||||
BOOST_LOG_TRIVIAL(info) << __FUNCTION__ << ": finished add script message handler for wx.";
|
||||
|
||||
#ifndef __WIN32__
|
||||
});
|
||||
#endif
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue