When dwsExprs is added to a DLL, his finalization section freeze. Actaully TdwsGuardianThread.Finalize is frozen on the line guardian.WaitFor.
To demonstrate the issue, I made a sample DLL, which is empty and only include dwsCript. I also made a test application loading the DLL and freeing it immediately. On exit the application freeze as I said above (Put a breakpoint on guardian.WaitFor to see that.
Sample DLL:
library DlltestDll;
uses
dwsExprs;
{$R *.res}
begin
end.
Sample application:
program DllTest;
{$APPTYPE CONSOLE}
{$R *.res}
uses
Windows;
var
HDll : HMODULE;
begin
HDll := LoadLibrary('DllTestDll.dll');
FreeLibrary(HDll);
end.
I'm using XE4 and DWScript extracted from SVN repository may 26.
Any help appreciated.