Commit a8e138af authored by Ken Martin's avatar Ken Martin Committed by Kitware Robot

Merge topic 'fix_texture_resource_issue'

f089989f fix an issue with release graphics resources
Acked-by: Kitware Robot's avatarKitware Robot <kwrobot@kitware.com>
Merge-request: !1993
parents bace0bcf f089989f
......@@ -366,13 +366,15 @@ bool vtkTextureObject::LoadRequiredExtensions(vtkOpenGLRenderWindow *renWin)
//----------------------------------------------------------------------------
void vtkTextureObject::SetContext(vtkOpenGLRenderWindow* renWin)
{
this->ResourceCallback->RegisterGraphicsResources(renWin);
// avoid pointless reassignment
if (this->Context == renWin)
{
return;
}
this->ResourceCallback->RegisterGraphicsResources(renWin);
this->ResetFormatAndType();
this->Context = NULL;
this->Modified();
......@@ -428,6 +430,8 @@ void vtkTextureObject::CreateTexture()
{
assert(this->Context);
this->ResourceCallback->RegisterGraphicsResources(this->Context);
// reuse the existing handle if we have one
if (!this->Handle)
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment