X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/66ac04006071ae2043c483ae93f8d4fa6888f33f..88932ec82d048d006cdc81bd309f5e59aee799ac:/src/gtk/webview_webkit.cpp?ds=inline diff --git a/src/gtk/webview_webkit.cpp b/src/gtk/webview_webkit.cpp index 278f445f59..3e9008503f 100644 --- a/src/gtk/webview_webkit.cpp +++ b/src/gtk/webview_webkit.cpp @@ -18,6 +18,7 @@ #include "wx/gtk/private.h" #include "wx/filesys.h" #include "wx/base64.h" +#include "wx/log.h" #include // ---------------------------------------------------------------------------- @@ -32,11 +33,6 @@ wxgtk_webview_webkit_load_status(GtkWidget* widget, GParamSpec*, wxWebViewWebKit *webKitCtrl) { - // We can be called from webkit_web_view_dispose() during the window - // destruction, don't use half-destroyed object in this case. - if ( webKitCtrl->IsBeingDeleted() ) - return; - wxString url = webKitCtrl->GetCurrentURL(); WebKitLoadStatus status; @@ -390,6 +386,11 @@ wxgtk_webview_webkit_resource_req(WebKitWebView *, wxIMPLEMENT_DYNAMIC_CLASS(wxWebViewWebKit, wxWebView); +wxWebViewWebKit::wxWebViewWebKit() +{ + m_web_view = NULL; +} + bool wxWebViewWebKit::Create(wxWindow *parent, wxWindowID id, const wxString &url, @@ -455,11 +456,8 @@ bool wxWebViewWebKit::Create(wxWindow *parent, wxWebViewWebKit::~wxWebViewWebKit() { - // The main goal here is to set m_isBeingDeleted to true to avoid the use - // of this -- already half-destroyed -- object from WebKit callbacks, but - // just setting it would prevent wxWindowDestroyEvent from being sent, so - // send it now instead. - SendDestroyEvent(); + if (m_web_view) + GTKDisconnect(m_web_view); } bool wxWebViewWebKit::Enable( bool enable ) @@ -1006,7 +1004,7 @@ void wxWebViewWebKit::FindClear() wxVisualAttributes wxWebViewWebKit::GetClassDefaultAttributes(wxWindowVariant WXUNUSED(variant)) { - return GetDefaultAttributesFromGTKWidget(webkit_web_view_new); + return GetDefaultAttributesFromGTKWidget(webkit_web_view_new()); }