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 <noreply@anthropic.com>
This commit is contained in:
r-zakarya
2026-10-05 18:04:21 +01:00
parent e8e93cba56
commit 27afc4e8ca
+13
View File
@@ -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%\<exe>\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