Skip to content

Calling Close on an ICoreWebView2Controller instance pumps messages #3140

Open
@cylvoon

Description

@cylvoon

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

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions