Closed uvwx413 closed 1 year ago
Here is another test code
program wsTest;
uses SysUtils,
{$DEFINE LGENERICS_054}
{$IFDEF LGENERICS_054} LGTreeSet, LGHashSet;
{$ELSE} lgTreeSet, lgHashSet;
{$ENDIF}
type
TWordSet = specialize TGLiteTreeSet<string, string>;
var
wSet: TWordSet;
w: string;
i: integer;
begin
Writeln('And 10 words to wSet');
Randomize;
for i:=1 to 10 do
begin
w := 'Random_' + IntToStr(Random(100));
wSet.Add( w );
Writeln( w );
end;
Writeln('Words in wSet:');
for w in wSet do // LGenerics_master: raise exception on lgAvlTree.pas line 2666
Writeln( w );
Writeln('END.');
Readln;
end.
Is it memory overwrite? ( initialization has done at Line 2624 : FNodes[Result].ClearLinks; )
Thanks for the feedback. It seems that the problem was initialization of TGLiteTreeSet enumerators. Looks like this is fixed now?
Thank you very much! LGenerics is an EXCELENT library!
on MX-Linux, Mint Linux, code like here will raise invalid pointer error, but on Windows 7, everything go right and if I switch back to LGenerics_054, non error
// my test code
// the lgAvlTree .pas
Compiler: FPC 3.2.2 Lazarus: 2.2.6