From 27afc4e8ca360d46ca3c2fc559d6552233430d82 Mon Sep 17 00:00:00 2001 From: r-zakarya <82443831+r-zakarya@users.noreply.github.com> Date: Mon, 5 Oct 2026 18:04:21 +0100 Subject: [PATCH] fix(webview): cache Edge vide au demarrage, plus a la fermeture TMS effacait EdgeCache dans son destructeur pendant que msedgewebview2 supprimait encore ses fichiers : EDirectoryNotFoundException (DIPS-wal) a la fermeture. AutoClearCache coupe ; l'app vide le dossier avant de creer le navigateur. Cinq lancements / fermetures sans erreur. Co-Authored-By: Claude Opus 5.5 --- delphi-backend/UMainForm.pas | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/delphi-backend/UMainForm.pas b/delphi-backend/UMainForm.pas index 1365346..389527d 100644 --- a/delphi-backend/UMainForm.pas +++ b/delphi-backend/UMainForm.pas @@ -295,7 +295,20 @@ begin // USE_EDGE_BROWSER} directive can swap the concrete class without a // second .fmx variant. Align Client to fill the area below PanelTop // and above the (collapsible) PanelLog + Splitter. + // CACHE EFFACE AU DEMARRAGE, PAS A LA FERMETURE. TMS l'effacait dans son + // destructeur, pendant que les processus msedgewebview2 supprimaient encore + // leurs propres fichiers : un fichier disparu en cours de parcours + // (EBWebView\Default\DIPS-wal) levait EDirectoryNotFoundException, non + // rattrapee, a la fermeture. Ici aucun moteur ne tourne encore - la garde + // d'instance unique est passee dans le .dpr. Meme dossier que TMS : + // %TEMP%\\EdgeCache. Echec ignore : un cache reste un cache. + try + TDirectory.Delete(TPath.Combine(TPath.Combine(TPath.GetTempPath, + ChangeFileExt(ExtractFileName(ParamStr(0)), '')), 'EdgeCache'), True); + except + end; WebBrowser := TWebBrowserClass.Create(Self); + WebBrowser.AutoClearCache := False; // Wire events BEFORE Parent assignment: setting Parent triggers the // TMS browser's async WebView2 init, which fires OnInitialized when // Edge Chromium is ready. If we assigned the handlers afterwards we'd