LazLogger: fixed thread race condition. If the logger is destroyed, and threads have pending sync calls. (only observed with custom created loggers). Fix requires fpc 3.2, see issue #0030567

git-svn-id: trunk@62036 -
This commit is contained in:
martin 2019-10-11 12:07:22 +00:00
parent e6a89c7f7c
commit 57e0e15e0f

View File

@ -255,6 +255,8 @@ end;
destructor TLazLoggerFileHandleMainThread.Destroy;
begin
// Call Syncronize (in the main thread) before destroy to catch any pending log
TThread.RemoveQueuedEvents(@MainThreadWrite);
inherited Destroy;
DoneCriticalsection(FWriteToFileLock);
end;