hschmid67 0 Posted January 11, 2019 Hello, If I understand everthing right (in the official book about OTL) then one needs no monitor if a task is scheduled (instead of run) - the monitor schould be implicit. I have a very simple example that runs not as expected (using OTL 3.07.6 Tokyo): This code works (with and without the line ".MonitorWith(OmniEventMonitor1)" for i := 1 to 3 do begin CreateTask( procedure(const mTask: IOmniTask) begin CodeSite.Send('curmsg'); end, 'hallo') .MonitorWith(OmniEventMonitor1) .Run; end; But this code does not. It works only with the line ".MonitorWith(OmniEventMonitor1)". Without nothing happens (no codesite messages). for i := 1 to 3 do begin CreateTask( procedure(const mTask: IOmniTask) begin CodeSite.Send('curmsg'); end, 'hallo') .MonitorWith(OmniEventMonitor1) .Schedule; end; Did I miss something? After the second example I get a memory leak after closing my app (without the monitorwith). Regards Harald Share this post Link to post