revalNG / omnithreadlibrary

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

IOmniBlockingCollection memory leak #75

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
In case when collection has string or variant element data type, memory leaks 
occurs if collections is used as parameter in Parallel.ForEach.
Example to reproduce error:

var
  oct : IOmniBlockingCollection;
begin
  oct := TOmniBlockingCollection.Create();
  oct.Add('1234');
  oct.CompleteAdding;
  Parallel.ForEach(oct).Execute(
                  procedure(const value: TOmniValue)
                  begin
                  end
    );
  oct := nil;
end;

FastMM reports line oct.Add('1234') as source line, and TOmniStringData, 
UnicodeString as class associated with leak.
Curious thing is that there is no leak when :
 - collection has simple type (f.e. integer) and ForEach is called
 - ForEach is not called

Original issue reported on code.google.com by marcin.r...@gmail.com on 2 Jan 2015 at 10:49

GoogleCodeExporter commented 9 years ago
i forgot about versions: xe2, otl from svn trunk

Original comment by marcin.r...@gmail.com on 2 Jan 2015 at 10:58