diff options
-rw-r--r-- | examples/apps/ide/src/filemonitor.pas | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/examples/apps/ide/src/filemonitor.pas b/examples/apps/ide/src/filemonitor.pas index 2a6c6113..45c6f524 100644 --- a/examples/apps/ide/src/filemonitor.pas +++ b/examples/apps/ide/src/filemonitor.pas @@ -239,8 +239,26 @@ begin end; procedure TFileMonitor.RemoveFile(const AFilename: TfpgString); +var + i: integer; + lFile: TMonitoredFile; + lst: TList; begin - // + lst := FFileList.LockList; + try + for i := 0 to lst.Count-1 do + begin + if AFilename = TMonitoredFile(lst[i]).Name then + begin + lFile := TMonitoredFile(lst[i]); + lst.Delete(i); + lFile.Free; + break; + end; + end; + finally + FFileList.UnlockList; + end; end; end. |