Changeset 11113

Show
Ignore:
Timestamp:
02/25/10 18:18:46 (5 years ago)
Author:
robert
Message:

From J.P. Delport: "by some strange circumstance I've stumbled across the following problem:

I create a compositeviewer with two views that share a context. One view is deleted. Texture::TextureObjectSet::discardAllTextureObjects is called, but this does not reset _tail. Now the texture object is again created and addToBack is called from Texture::TextureObjectSet::takeOrGenerate. In addToBack (line 612) _tail is now not 0 (although the list should be empty) and a loop is created from the texture object to itself. Then when the second view is deleted, Texture::TextureObjectSet::deleteAllTextureObjects loops forever. Setting _tail to 0 fixes it for me (see attached)."

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • OpenSceneGraph/trunk/src/osg/Texture.cpp

    r10900 r11113  
    197197            if (_tail != to) 
    198198            { 
    199                 osg::notify(osg::NOTICE)<<"Texture::TextureObjectSet::checkConsistency() : Error _trail != to"<<std::endl; 
     199                osg::notify(osg::NOTICE)<<"Texture::TextureObjectSet::checkConsistency() : Error _tail != to"<<std::endl; 
    200200                return false; 
    201201            } 
     
    310310    // the linked list should now be empty 
    311311    _head = 0; 
     312    _tail = 0; 
    312313 
    313314    _pendingOrphanedTextureObjects.clear(); 
     
    509510 
    510511    // 
    511     // no TextureObjects available to recyle so have to create one from scratch 
     512    // no TextureObjects available to recycle so have to create one from scratch 
    512513    // 
    513514    GLuint id;