From 3c707bb1041827d185f637fc5b6315b1c066fe48 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Salvador=20D=C3=ADaz=20Fau?= Date: Mon, 9 Oct 2017 14:59:46 +0200 Subject: [PATCH] Now TCEFApplication sets back the old directory after the DLLs are loaded --- source/uCEFApplication.pas | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/source/uCEFApplication.pas b/source/uCEFApplication.pas index e28b7b45..96169b2f 100644 --- a/source/uCEFApplication.pas +++ b/source/uCEFApplication.pas @@ -858,8 +858,14 @@ begin end; function TCefApplication.LoadCEFlibrary : boolean; +var + TempOldDir : string; begin - if FSetCurrentDir then chdir(GetModulePath); + if FSetCurrentDir then + begin + TempOldDir := GetCurrentDir; + chdir(GetModulePath); + end; FLibHandle := LoadLibraryEx(PChar(LibCefPath), 0, LOAD_WITH_ALTERED_SEARCH_PATH); @@ -922,6 +928,8 @@ begin Result := False; OutputDebugMessage('TCefApplication.LoadCEFlibrary error: Unsupported CEF version !'); end; + + if FSetCurrentDir then chdir(TempOldDir); end; function TCefApplication.Load_cef_app_capi_h : boolean;