else
{
myResources.Texture.Nullify(); // we need nullify all handles before ReleaseResource() call
- theContext->ReleaseResource (myResources.TextureId);
+ theContext->ReleaseResource (myResources.TextureId, Standard_True);
}
}
myResources.Texture.Nullify();
theShareKey = theProxy->GetId();
if (myContext->GetResource<Handle(OpenGl_ShaderProgram)> (theShareKey, theProgram))
{
- theProgram->Share();
+ if (theProgram->Share())
+ {
+ myProgramList.Append (theProgram);
+ }
return;
}
else
{
theProgram.Nullify();
- myContext->ReleaseResource (anID);
+ myContext->ReleaseResource (anID, Standard_True);
}
}
//! Increments counter of users.
//! Used by OpenGl_ShaderManager.
- void Share()
+ //! @return true when resource has been restored from delayed release queue
+ bool Share()
{
- ++myShareCount;
+ return ++myShareCount == 1;
}
//! Decrements counter of users.