Hang in TdwsGuardianThread.Finalize if used inside a DLL

Issue #1 new
Josef Kučera created an issue

What steps will reproduce the problem?

  1. Create a DLL with single DataModule and put DWScript on it.
  2. Use other app to load the DLL and create DataModule instance (not really necessary, just loading the DLL is enough).
  3. Unload the DLL -> TdwsGuardianThread.Finalize hangs (threads does not finish until the DLL unloading is finished).

What version of the product are you using? On what operating system?

Running SVN snapshot on Windows 7 x64 SP1

Comments (4)

  1. Eric Grange repo owner

    Then from what I gather the most stable solution would be to expose a function to your DLL that would call TdwsGuardianThread.Finalize, and call it manually before unloading the DLL :/

  2. Josef Kučera reporter

    Ahh, I understand. Would it be possible to add an Assert to the finalization section to notify developers? Perhaps something like: Assert(not System.IsLibrary or not Assigned(TdwsGuardianThread.vThread), 'CAUTION: Please call TdwsGuardianThread.Finalize before unloading the DLL.');

  3. Log in to comment