FastMM4
FastMM4 copied to clipboard
Problem with shared MM between exe and dll
I compile dll and exe with ShareMM option, but when I unload dll (FreeLibrary) from exe then FastMM hangs on FinalizeMemoryManager->DestroyCleanupThread called from DLL finalization.
procedure DestroyCleanupThread;
begin
if ReleaseStackCleanupThread <> 0 then
begin
SetEvent(ReleaseStackCleanupThreadTerminate);
WaitForSingleObject(ReleaseStackCleanupThread, INFINITE); <--- hangs on waiting
CloseHandle(ReleaseStackCleanupThread);
ReleaseStackCleanupThread := 0;
CloseHandle(ReleaseStackCleanupThreadTerminate);
ReleaseStackCleanupThreadTerminate := 0;
end;
end;
Without ShareMM options unloading DLL hangs too (when DLL is compiled with FastMM).