chromiumembedded / cef

Chromium Embedded Framework (CEF). A simple framework for embedding Chromium-based browsers in other applications.
https://bitbucket.org/chromiumembedded/cef/
Other
3.38k stars 467 forks source link

Not all file handles are closed after Cef.Shutdown #3726

Open Mik4sa opened 4 months ago

Mik4sa commented 4 months ago

Describe the bug I'm coming from CefSharp and was told to open an issue here. I hope this is fine. This is the original issue: https://github.com/cefsharp/CefSharp/issues/4852

I have set a custom RootCache path and want to delete that cache folder after Cef.Shutdown is called (during the application shutdown). But using the (new) Chrome Bootstrap some files still have open handles so the whole folder can't be deleted. Changing the runtime back to Alloy Bootstrap (in the same version) the folder can be deleted afterwards as expected.

Note: There is a big difference in what is written to that directory (not sure if this is a problem too). This is what I get with Alloy Bootstrap: image

and this is what I get with Chrome Bootstrap: image

Expected behavior All file handles should be cleared after Cef.Shutdown was successfully called.

Versions (please complete the following information):

Additional context

Does the problem reproduce with the cefclient or cefsimple sample application at the same version?

Not tested, but I don't think so since the folder isn't deleted afaik.

Does the problem reproduce with Google Chrome at the same version?

No

magreenblatt commented 4 months ago

What are the files with open handles? See here for tools that will tell you.

Mik4sa commented 4 months ago

Everything in the orange box: image

Note that my RootCache path is: %localappdata%/CefSharp/RootCache

magreenblatt commented 4 months ago

Are child processes still running after you call CefShutdown?

Mik4sa commented 4 months ago

Doesn't look so.

Before Cef.Shutdown: image

After Cef.Shutdown: image

magreenblatt commented 4 months ago

OK. Some of these files (like chrome_debug.log) likely aren't closed until all child processes have terminated.

Mik4sa commented 4 months ago

But all child processes are closed. The one process marked in the second screenshot is the main process (CefSharp...exe)

magreenblatt commented 4 months ago

But all child processes are closed. The one process marked in the second screenshot is the main process (CefSharp...exe)

Right, but in case they're not closed immediately after CefShutdown returns (for you or someone else), it could still be an issue.

tomeroed commented 1 month ago

We are also facing this exact issue, with no current solution. The following files are being held and can not be deleted when the application exits. 2024-10-23 14_10_25-

SASoper commented 3 weeks ago

This issue still exists in CefSharp.WinForms version 128.4.9.