[fpc-devel] Suggestion: reference counted objects
pascaldragon at googlemail.com
Thu Sep 25 17:14:30 CEST 2014
Am 25.09.2014 11:59 schrieb "Michael Schnell" <mschnell at lumino.de>:
> On 09/22/2014 08:37 PM, Boian Mitov wrote:
>> Honestly if you don’t know what you are doing when using ARC, I doubt a
bit, you really know what you are doing otherwise either ;-) .
> Ref counted strings are no problem with any (normal) use of same.
> In this thread you find an example describing how ARC Objects easily can
impose memory leaks.
Not really. The object instances themselves won't create memory leaks,
because with strings you don't get them either. The only problems are
typical "not threadsafe" problems of the classes themselves and there ARC
won't help you anyway as this is the programmer's job to ensure.
ARC objects will only be destroyed when the last reference to them has gone
out of scope. If there is still a reference, then there's still the object.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the fpc-devel