On Mon, 27 Aug 2012 16:40:39 +0200, Robert Osfield <robert.osfi...@gmail.com> wrote:

Hi Ola,

On 27 August 2012 15:23, Ola Nilsson <o...@weatherone.tv> wrote:
Hm, there is probably something I don't see. I am new to the code...

I assumed that a TerrainTile cannot be _completely_ deleted in the
Terrain::update call, because if it were it _must_ have passed through
Terrain::unregisterTile and then it wouldn't be in the update set to begin
with.

unregisterTile only gets called in the TerrainTile destructor after
it's ref count has gone to zero.  It'd be safe if unregisterTile was

Yes, the ref count is zero but the destructor chain has not yet completed, by induction it hasn't passed ~TerrainTile. (If it had unregisterTile would have been called and completed.) Right?

In this situation memory is not yet recycled and the object's parents data (Referenced) should be safe to access and even manipulate. Right?

Ola

Btw. the new code passes my modified osgterrain test, which of course doesn't prove anything...

called prior to the TerrailTile object's ref count goes to zero.



Therefore it is still safe to investigate the raw pointers in the
_updateTerrainTileSet in Terrain::update.

Do you agree on the assumption? If not can you exemplify when it doesn't
hold?

Nope it's not safe as explained above.

Robert.
_______________________________________________
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


--
Using Opera's revolutionary email client: http://www.opera.com/mail/
_______________________________________________
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to