Hi Robert
You've already make objection about propertization of Index in 
BufferIndexBinding ( unconst _index and add a setter): You objected that my 
setIndex was not thread safe

I would like your opinion about this body func:


Code:

void BufferIndexBinding::setIndex(GLuint index){

    StateSet**parents=new StateSet* [getNumParents()];
    StateAttribute::GLModeValue *parentmodes =new StateAttribute::GLModeValue  
[getNumParents()];
    unsigned int numparent=getNumParents();
    for(unsigned int i=0;i<numparent;i++)
    {
        parents[i]=getParent(i);
        
parentmodes[i]=parents[i]->getAttributeList().find(getTypeMemberPair())->second.second;
    }

    ref_ptr<StateAttribute> dummy=this;

    for(unsigned int i=0;i<numparent;i++)parents[i]->removeAttribute(this);

    _index=index;

    for(unsigned int i=0;i<numparent;i++)
        parents[i]->setAttributeAndModes(this,  parentmodes[i]);

    delete [] parents;
    delete [] parentmodes;

}



Is it still unsafe?


Thank you!

Cheers,
Julien

------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=67774#67774





_______________________________________________
osg-submissions mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-submissions-openscenegraph.org

Reply via email to