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)."
This commit is contained in:
@@ -196,7 +196,7 @@ bool Texture::TextureObjectSet::checkConsistency() const
|
||||
{
|
||||
if (_tail != to)
|
||||
{
|
||||
osg::notify(osg::NOTICE)<<"Texture::TextureObjectSet::checkConsistency() : Error _trail != to"<<std::endl;
|
||||
osg::notify(osg::NOTICE)<<"Texture::TextureObjectSet::checkConsistency() : Error _tail != to"<<std::endl;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -309,6 +309,7 @@ void Texture::TextureObjectSet::discardAllTextureObjects()
|
||||
|
||||
// the linked list should now be empty
|
||||
_head = 0;
|
||||
_tail = 0;
|
||||
|
||||
_pendingOrphanedTextureObjects.clear();
|
||||
_orphanedTextureObjects.clear();
|
||||
@@ -508,7 +509,7 @@ Texture::TextureObject* Texture::TextureObjectSet::takeOrGenerate(Texture* textu
|
||||
}
|
||||
|
||||
//
|
||||
// no TextureObjects available to recyle so have to create one from scratch
|
||||
// no TextureObjects available to recycle so have to create one from scratch
|
||||
//
|
||||
GLuint id;
|
||||
glGenTextures( 1L, &id );
|
||||
|
||||
Reference in New Issue
Block a user