Graeme Geldenhuys wrote:
>>   Test:=nil;
>>     
>
> This causes a memory leak - you did not actually free the class
> instance. You need to call:  Test.Free;
>   
Of course I didn't call free; I was hoping that the reference counter
would solve that little problem. If I need to free stuff myself, I don't
really need a reference counter. In any case, thanks for the answer. I
will give it a try and see what it gives
>>   Pest:=nil;
>>     
>
> Pest was just a reference pointer to the first instance, so no need to
> free it. But setting it to nil after Test was freed is a good habit.
>   
I'm not sure that is correct. Once you free Test, Pest still points to
the same non existing object and you can use assigned to check it,

-- 
http://werner.yellowcouch.org/


Attachment: signature.asc
Description: OpenPGP digital signature

_______________________________________________
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal

Reply via email to