From 13ede84dba27a86a9ab6920549c609920a7fbe27 Mon Sep 17 00:00:00 2001 From: jkour Date: Wed, 13 Nov 2024 22:48:59 +0000 Subject: [PATCH] * WaitFor when TFileMonitor is disabled If Enabled = false, the WaitFor in the destructor could not terminate --- Quick.FileMonitor.pas | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Quick.FileMonitor.pas b/Quick.FileMonitor.pas index 791ce89..e4bd9c7 100644 --- a/Quick.FileMonitor.pas +++ b/Quick.FileMonitor.pas @@ -105,7 +105,8 @@ constructor TFileMonitor.Create; destructor TFileMonitor.Destroy; begin if not Terminated then Terminate; - Self.WaitFor; + if fEnabled then + Self.WaitFor; fTickEvent.SetEvent; fTickEvent.Free; inherited;