POV-Ray : Newsgroups : povray.off-topic : A tale of two cities : Re: A tale of two cities Server Time
4 Sep 2024 19:00:41 EDT (-0400)
  Re: A tale of two cities  
From: Kevin Wampler
Date: 14 Mar 2012 12:33:08
Message: <4f60c844$1@news.povray.org>
On 3/14/2012 9:14 AM, clipka wrote:
>> And btw, cyclic references are not the only problematic situation with
>> reference counting. There are cases where objects may be deleted too
>> early,
>> while there's still code using them.
>
> I can't think of any reason why that could possibly happen, provided
> that the reference counting is implemented in a thread-safe manner.

Imagine you've implemented a tree where each node is an object which has 
a "delete" method that removes the node from the tree.  If you're not 
careful the node could end up removing all references-counted pointers 
to itself (since "this" isn't reference counted) and be reclaimed while 
still running its own delete method.


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.