[fpc-pascal] Reference Counting

cobines cobines at gmail.com
Mon Apr 5 08:41:24 CEST 2010


2010/4/5 Werner Van Belle <werner at yellowcouch.org>:
>> 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,

Pest would be a dangling pointer and should not be accessed.


I attached sample code with interfaces for you.

--
cobines
-------------- next part --------------
A non-text attachment was scrubbed...
Name: project1.lpr
Type: application/octet-stream
Size: 1133 bytes
Desc: not available
URL: <http://lists.freepascal.org/pipermail/fpc-pascal/attachments/20100405/7bfc47d2/attachment.obj>


More information about the fpc-pascal mailing list