From: Steve Lamerton Date: Tue, 18 Jun 2013 19:54:25 +0000 (+0000) Subject: Ensure that the default wxWebView backends are registered. X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/8fdbcf4de8eeff67ccfaf3deec833d203f112629 Ensure that the default wxWebView backends are registered. Fixes #15261 git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@74251 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/src/common/webview.cpp b/src/common/webview.cpp index 96435027c9..4b2e7dc8ce 100644 --- a/src/common/webview.cpp +++ b/src/common/webview.cpp @@ -89,9 +89,8 @@ void wxWebView::RegisterFactory(const wxString& backend, // static wxStringWebViewFactoryMap::iterator wxWebView::FindFactory(const wxString &backend) { - // Initialise the map if needed - if(m_factoryMap.empty()) - InitFactoryMap(); + // Initialise the map, it checks internally for existing factories + InitFactoryMap(); return m_factoryMap.find(backend); } @@ -100,10 +99,12 @@ wxStringWebViewFactoryMap::iterator wxWebView::FindFactory(const wxString &backe void wxWebView::InitFactoryMap() { #ifdef __WXMSW__ - RegisterFactory(wxWebViewBackendIE, wxSharedPtr + if(m_factoryMap.find(wxWebViewBackendIE) == m_factoryMap.end()) + RegisterFactory(wxWebViewBackendIE, wxSharedPtr (new wxWebViewFactoryIE)); #else - RegisterFactory(wxWebViewBackendWebKit, wxSharedPtr + if(m_factoryMap.find(wxWebViewBackendWebKit) == m_factoryMap.end()) + RegisterFactory(wxWebViewBackendWebKit, wxSharedPtr (new wxWebViewFactoryWebKit)); #endif }