On Wed, Jun 18, 2008 at 5:27 PM, Michael Platings
<[EMAIL PROTECTED]> wrote:
> I'm not sure I understand you. My point is that the address of a Uniform
> *can't* be used as a unique ID, because in between frames the Uniform
> can be destroyed and another created at the same address.

OK, I get it know. Sorry in my speed reading I didn't spot the subtly
of the issue.

> Another option I initially used was to replace the "const Uniform*" with
> "ref_ptr<Uniform>", which guaranteed that the address could not be
> vacated and then replaced with another Uniform. However I decided
> against that as it would delay freeing memory, and may have other side
> effects.

Keeping a ref_ptr<> is not such a bad solution - the memory involved
is tiny, but..
the performance won't be as good, although given your adding uniqueID
and counting
of this then the alternative isn't free.

I'll do a review of your code and make a judgement call on whether to
run with a uniqueID,
a ref_ptr<> or an alternative.

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

Reply via email to