Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Webviews are still not properly closed #350

Open
akuznecov opened this issue Dec 20, 2024 · 5 comments
Open

Webviews are still not properly closed #350

akuznecov opened this issue Dec 20, 2024 · 5 comments

Comments

@akuznecov
Copy link

akuznecov commented Dec 20, 2024

New sub process/thread is created for WebView2 on every item lookup and not closed until application exit
It could accumulate huge pile of memory on aggressive items inspection

image

Sidekick app version: beta 2024.12.20.608

Related issue/pr: #290 #298

@Theblackcat98
Copy link

I'd like to confirm I'm also having the same issue and noticed it after invisible window frames started to show up and never close.

image

In the screenshot, I opened Sidekick, then minimized, then opened again from the hidden icons in the start bar. Hence the 2 window frames plus the visible settings pane.

@domialex
Copy link
Contributor

@akuznecov @Theblackcat98
Can you still reproduce this bug with the latest beta?

@leMicin
Copy link
Contributor

leMicin commented Dec 26, 2024

It can be reliably triggered by price checking another item while having the trade window opened. @domialex found this: dotnet/maui#26746

@akuznecov
Copy link
Author

@akuznecov @Theblackcat98 Can you still reproduce this bug with the latest beta?

Hello @domialex, unfortunately yes, it still reproducible with 2024.12.26.118

@KeterSCP
Copy link

KeterSCP commented Jan 2, 2025

@leMicin the problem is not with DisposeAsync, but with calling EnsureCoreWebView2Async on the wrong thread (thread pool thread):

image

This async lambda is explicitly pushed on the thread pool via Task.Run, and it's exception is swallowed and ignored (the problem would be easier to spot if the exception was at least logged and not completely ignored).

Documentation for the webview2 states that:

Unless previous initialization has already failed, calling this method with a different environment after initialization has begun will result in an ArgumentException

That's why it is failing on thread from thread pool - because it was initially initialized on the UI thread.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants