#19041: wxWebView (Edge) does not unload WebView2Loader.dll on failure

100 views
Skip to first unread message

wxTrac

unread,
Jan 13, 2021, 11:51:54 AM1/13/21
to wx-...@googlegroups.com
#19041: wxWebView (Edge) does not unload WebView2Loader.dll on failure
---------------------------+-------------------------
Reporter: rk | Owner:
Type: defect | Status: new
Priority: normal | Milestone:
Component: WebView | Version: dev-latest
Keywords: Edge WebView2 | Blocked By:
Blocking: | Patch: 0
---------------------------+-------------------------
In {{{wxWebViewEdgeImpl::Initialize()}}} in "src/msw/webview_edge.cpp" the
code tries to load "WebView2Loader.dll". If this succeeds the code tries
to get two function pointers from the dll and after that calls those
functions.

If any of these things fail {{{Initialize()}}} simply returns {{{false}}}
but does not unload the dll. This makes it impossible to call
{{{Initialize()}}} again because the dll loader asserts that the dll is
not loaded already.

The fix is to call {{{ms_loaderDll.Unload();}}} before the two {{{return
false}}} in the method.

--
Ticket URL: <https://trac.wxwidgets.org/ticket/19041>

wxTrac

unread,
Jan 24, 2021, 6:16:43 PM1/24/21
to wx-...@googlegroups.com
#19041: wxWebView (Edge) does not unload WebView2Loader.dll on failure
----------------------+---------------------------
Reporter: rk | Owner:
Type: defect | Status: new
Priority: normal | Milestone:
Component: WebView | Version: dev-latest
Resolution: | Keywords: Edge WebView2
Blocked By: | Blocking:
Patch: 1 |
----------------------+---------------------------
Changes (by vadz):

* patch: 0 => 1


Comment:

Should be fixed by [https://github.com/wxWidgets/wxWidgets/pull/2188 this
PR].

--
Ticket URL: <https://trac.wxwidgets.org/ticket/19041#comment:1>

wxTrac

unread,
Jan 25, 2021, 7:03:38 AM1/25/21
to wx-...@googlegroups.com
#19041: wxWebView (Edge) does not unload WebView2Loader.dll on failure
----------------------+-------------------------------------
Reporter: rk | Owner: Vadim Zeitlin <vadim@…>
Type: defect | Status: closed
Priority: normal | Milestone:
Component: WebView | Version: dev-latest
Resolution: fixed | Keywords: Edge WebView2
Blocked By: | Blocking:
Patch: 1 |
----------------------+-------------------------------------
Changes (by Vadim Zeitlin <vadim@…>):

* status: new => closed
* owner: => Vadim Zeitlin <vadim@…>
* resolution: => fixed


Comment:

In [changeset:"bc825de1fe5c5323358242cdf9ea57bee4b8139e/git-wxWidgets"
bc825de1f/git-wxWidgets]:
{{{
#!CommitTicketReference repository="git-wxWidgets"
revision="bc825de1fe5c5323358242cdf9ea57bee4b8139e"
Simplify and make more robust wxWebViewEdge initialization

Get rid of ms_isInitialized as it must be kept synchronized with
ms_loaderDll.IsLoaded() anyhow, and it's simpler to not have it at all
rather than ensuring this.

Also ensure that calling Initialize() again, after doing it first
unsuccessfully, doesn't assert because ms_loaderDll is already loaded,
by only leaving it with a valid handle if the initialization succeeded.

Closes #19041.
}}}

--
Ticket URL: <https://trac.wxwidgets.org/ticket/19041#comment:2>
Reply all
Reply to author
Forward
0 new messages