MicrosoftEdge / MicrosoftEdge/WebView2Feedback
Calling Close on an ICoreWebView2Controller instance pumps messages
@champnic is already working on this.
Since Jan 23, 2023.
- Dominant language
- PowerShell
- Stars
- 526
- Forks
- 67
- PR merge metrics
- No merged PRs in 30d
Description
ICoreWebView2Controller::Close is a synchronous call, but apparently it manually pumps messages, creating unwanted reentrancy...
Proof: I call Close from a posted message handler, right after having posted another message, and and while Close has not returned yet, my other message handler is called.
the pseudo stack would be looks like:
messageA handler
post messageB
ICoreWebView2Controller::Close
messageB handler
// End of messageB handler
// End of ICoreWebView2Controller::Close
// End of messageA handler
This is really bad. It's known for ages that manually pumping messages is a very bad practice, and there's only very few cases where it's necessary (but never hidden in a black box as here, too dangerous).
As a consequence, I have to add some dirty code to avoid a crash, and I can't do nothing clean about it. So please, look into this and fix it.
It seems it appeared since the last evergreen runtime update, but I can't verify whether it's a regression or not, as it's impossible to downgrade webview2 to compare....
EDIT: I finally found a way to test with the previous runtime version available 108.0.1462.76, and the problem doesn't exist.
It may be related to #3141 .
SDK: 1.0.1518.46
Runtime: 109.0.1518.52
Framework: MFC
OS: Win10
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.