CmzSQuid / omnithreadlibrary

Automatically exported from code.google.com/p/omnithreadlibrary
0 stars 0 forks source link

Memory leak when using IOmniTaskControl.Terminate() function #63

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
> What steps will reproduce the problem?

1. Run a task which allocates some Memory to the heap and frees the memory in a 
finally block, such as...

  function MemoryTest: boolean;
  var
    aStringList: TStringList;
    i: Integer;
  begin
    try
      aStringList := TStringList.Create;
      for i := 0 to 100000 do aStringList.Add('Testing');
      repeat
          Sleep(1000);
      until (1 = 0);
    finally
      FreeAndNil(aStringList);
    end;
  end;

2. Call the IOmniTaskControl.Terminate() function while the task is still 
running

> What is the expected output? What do you see instead?

I suppose I don't know what to expect here, but I would like to know if it's 
possible to somehow trigger the Finally Block, or even to raise an exception 
inside the thread in question so that it can be gracefully terminated.

> What version of the product are you using? On what operating system?

3.03, Delphi XE2, Windows 7

Regards,
Mark

Original issue reported on code.google.com by MarkStev...@gmail.com on 29 May 2014 at 1:17