AW: AW: [fpc-devel] Bug 0007281 / MemLeak with interfaces

Helmut Hartl helmut.hartl at firmos.at
Wed Nov 8 03:55:08 CET 2006


Florian Klaempfl schrieb:

 > I merged the patch but help us to test 2.1.1 as much as possible
based
 > on the revisions known to be good
 > (http://www.freepascal.org/wiki/index.php/Tested_Unstable_Revisions)
so
 > we can get 2.2.0 out asap (head is currently broken due to heavy
 > rewrites).

Thank you very much form merging. -> 2.0.4 Fixes looks better now... :-)

 > The perfect solution for your users would be if you run daily
regression
 > tests with trunk and tell users which revisions work good with Zeos
 > (currently 5191 is a good bet) and tell us if you get worse test
results.

I found a very strange memory leak occurring with 2.1.1.

Bug is: 0007776 / FPC Revision 5191
http://www.freepascal.org/mantis/view.php?id=7776


--------------------------------
program zeos_memhole2;
{$mode objfpc}{$H+}

Function dlopen(Name : PChar; Flags : longint) : Pointer; cdecl;
external 'dl'; //A

Type
  TTest=class
   function Find(const Value:String):TTest;
  end;
 { TTest }
 function TTest.Find(const Value: String): TTest;
 // var i:integer; //C
 begin
  if (Length(Value) > 1) and (Result <> nil) then begin
   result:=Find(Copy(Value, 2, Length(Value) - 1));
   // x:=Find(Copy(Value, 2, Length(Value) - 1)); // B
   // result:=x;
  end;
 end;
 var TT:TTest;
begin
 TT:=TTest.Create;
 TT.Find('AA');
 TT.Free;
end.  
--------------------------------

Comment Line //A or uncomment line //B or //C 
and the problem is "fixed" :-)

helmut





More information about the fpc-devel mailing list