While trying to debug our application I started looking at the ref
count polices and had a question. If we execute the following code I
am unsure if the correct addRef and subRef methods get called:

OSG::NodeRecPtr rec_node = OSG::Node::create();
OSG::NodeUnrecPtr unrec_node = OSG::Node::create();

unrec_node = rec_node;


Then the following code gets executed for the assignment:



template <class ObjectT,
         class RefCountPolicyT> inline
typename RefCountPtr<ObjectT, RefCountPolicyT>::Self &
   RefCountPtr<ObjectT, RefCountPolicyT>::operator =(
       Object * const objectPtr)
{
   if(_pObj != objectPtr)
       RefCountPolicy::setRefd(_pObj, objectPtr);

   return *this;
}

This will call:

       UnrecordedRefCountPolicy::addRef(pSource);
       UnrecordedRefCountPolicy::subRef(pTarget);


Which will not do the correct counting for the rec_node, right?

-Aron

------------------------------------------------------------------------------
Apps built with the Adobe(R) Flex(R) framework and Flex Builder(TM) are
powering Web 2.0 with engaging, cross-platform capabilities. Quickly and
easily build your RIAs with Flex Builder, the Eclipse(TM)based development
software that enables intelligent coding and step-through debugging.
Download the free 60 day trial. http://p.sf.net/sfu/www-adobe-com
_______________________________________________
Opensg-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensg-users

Reply via email to