mirror of
https://github.com/paweld/simple-logger
synced 2025-04-05 04:47:41 +02:00
fixes related to waiting for the log to be written to a file
tested on Windows
This commit is contained in:
parent
8b98d1a9ca
commit
74ddb0e858
@ -422,7 +422,7 @@ end;
|
|||||||
procedure TSaveLogThread.Execute;
|
procedure TSaveLogThread.Execute;
|
||||||
var
|
var
|
||||||
sleepms: Integer;
|
sleepms: Integer;
|
||||||
cs: Int64;
|
cs: QWord;
|
||||||
|
|
||||||
function GetSleepMs: Integer; inline;
|
function GetSleepMs: Integer; inline;
|
||||||
begin
|
begin
|
||||||
@ -433,7 +433,7 @@ var
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
begin
|
begin
|
||||||
sleepms := GetSleepMs;
|
sleepms := 0;
|
||||||
cs := GetTickCount64;
|
cs := GetTickCount64;
|
||||||
while not Terminated do
|
while not Terminated do
|
||||||
begin
|
begin
|
||||||
@ -497,6 +497,8 @@ end;
|
|||||||
|
|
||||||
destructor TLogger.Destroy;
|
destructor TLogger.Destroy;
|
||||||
begin
|
begin
|
||||||
|
while FLogList.Count > 0 do
|
||||||
|
sleep(1);
|
||||||
if FSaveThread <> nil then
|
if FSaveThread <> nil then
|
||||||
begin
|
begin
|
||||||
FSaveThread.Terminate;
|
FSaveThread.Terminate;
|
||||||
|
Loading…
Reference in New Issue
Block a user