Skip to content

Commit

Permalink
Bug: Files still being in use after Cef.Shutdown
Browse files Browse the repository at this point in the history
  • Loading branch information
Mik4sa committed Jun 27, 2024
1 parent 12a9dca commit 28c9693
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion CefSharp.MinimalExample.WinForms/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,12 @@ public static int Main(string[] args)
CefRuntime.SubscribeAnyCpuAssemblyResolver();
#endif

var rootCachePath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData), "CefSharp\\RootCache");

var settings = new CefSettings()
{
//By default CefSharp will use an in-memory cache, you need to specify a Cache Folder to persist data
CachePath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData), "CefSharp\\Cache")
RootCachePath = rootCachePath
};

//Example of setting a command line argument
Expand Down Expand Up @@ -50,6 +52,10 @@ public static int Main(string[] args)
Application.EnableVisualStyles();
Application.Run(new BrowserForm());

Cef.Shutdown();

Directory.Delete(rootCachePath, true);

return 0;
}
}
Expand Down

0 comments on commit 28c9693

Please sign in to comment.