[fpc-pascal]Memory leak in freepascal, FreeAndNil not working properly?

Andreas Gros andreas.gros at biozentrum.uni-wuerzburg.de
Wed Jun 23 17:37:08 CEST 2004


> You code is wrong, it also crashes with kylix.

What kind of answer is this? That it is not working in Kylix either does 
certainly not mean their memory handling is correct. 

Please look at the code. The crash is supposed to happen, because it is the 
same object, that is addressed both times I say FreeAndNil. 
But that means, that FreeAndNil is not working properly and due to that 
TList.pack can't work because it is not a nil-pointer, that's coming back 
from FreeAndNil.
Otherwise it can't be possible, to address the same object again after calling 
FreeAndNil.



Ciao

Andreas


Am Mittwoch, 23. Juni 2004 17:11 schrieb Peter Vreman:
> > Hi folks,
> >
> > please check out this code (unit). Certainly there is something very
> > strange
> > going on in handling memory in freepascal. I'm using Free Pascal Compiler
> > version 1.9.4 [2004/05/30] for i386.
>
> <snip code>
>
> You code is wrong, it also crashes with kylix.
>
>
>
> _______________________________________________
> fpc-pascal maillist  -  fpc-pascal at lists.freepascal.org
> http://lists.freepascal.org/mailman/listinfo/fpc-pascal

-- 
Andreas Gros
Forschungsstation Fabrikschleichach
Uni Wuerzburg
Glashuettenstr. 5
96181 Rauhenebrach




More information about the fpc-pascal mailing list