Disclosure Statement: This site contains affiliate links, which means that I may receive a commission if you make a purchase using these links. As an eBay Partner, I earn from qualifying purchases.
RedOctober
Posts: 8 Joined: Sat Jul 07, 2018 12:59 pm
Location: Montenegro
Contact:
Post
by RedOctober » Mon Sep 17, 2018 9:27 pm
Hello,
I try to remove Chromium's cache at application startup:
Since it can take a lot of time, I want to show the splash screen. But my splash screen is only shown
after the cache removal is complete. What I'm doing wrong? This is part of my dpr file:
Code: Select all
GlobalCEFApp := TCefApplication.Create;
GlobalCEFApp.LocalesDirPath := 'locales';
GlobalCEFApp.EnableGPU := false;
GlobalCEFApp.cache := 'cache';
GlobalCEFApp.cookies := 'cookies';
GlobalCEFApp.UserDataPath := 'user';
GlobalCEFApp.DeleteCache:=true;
if GlobalCEFApp.StartMainProcess then
begin
application.Initialize;
Splash_Screen := TSplash_Screen.Create(nil);
Splash_Screen.Show;
Splash_Screen.Update;
application.CreateForm(TMiniBrowserFrm, MiniBrowserFrm);
Splash_Screen.Hide;
Splash_Screen.Free;
application.Run;
end;
GlobalCEFApp.Free;
salvadordf
Posts: 4564 Joined: Thu Feb 02, 2017 12:24 pm
Location: Spain
Contact:
Post
by salvadordf » Tue Sep 18, 2018 7:58 am
Hi,
The cache is deleted synchronously inside the GlobalCEFApp.StartMainProcess call and TSplash_Screen is created after that.
I'll try to rename the cache directory and delete it in a thread. In this case you won't even need a splash screen.
I'll update CEF4Delphi and OldCEF4Delphi with this modification as soon as I can.
salvadordf
Posts: 4564 Joined: Thu Feb 02, 2017 12:24 pm
Location: Spain
Contact:
Post
by salvadordf » Tue Sep 18, 2018 1:39 pm
I just uploaded a new version of CEF4Delphi and OldCEF4Delphi that renames and deletes the cache and cookies directories in a thread.
If there's some kind of problem renaming the directories it will try to delete the contents without a thread.