MantisBT - VTK
View Issue Details
0010017VTK(No Category)public2009-12-09 06:432016-08-12 09:55
Xavi 
Kitware Robot 
normaltrivialalways
closedmoved 
 
 
0010017: Check list id before delete
When vtkOpenGLDisplayListPainter::ReleaseGraphicsResources(vtkWindow* win) is called with a vtkWindow not used by the vtkOpenGLDisplayListPainter, the memory is not released.

We can call the function glIsList() to check that the current window is the active one when the list was created.
We can fix it with this code:

void vtkOpenGLDisplayListPainter::ReleaseList()
{
  if (this->DisplayListId)
    {
      if ( glIsList( this->DisplayListId ) == GL_TRUE )
      {
          glDeleteLists(this->DisplayListId, 1);
          this->DisplayListId = 0;
      }
    }
}
No tags attached.
Issue History
2009-12-09 06:43XaviNew Issue
2009-12-11 11:54François BertelStatusbacklog => tabled
2009-12-11 11:54François BertelAssigned To => François Bertel
2009-12-11 12:02François BertelNote Added: 0018819
2009-12-14 09:34XaviNote Added: 0018844
2010-09-07 13:44François BertelAssigned ToFrançois Bertel =>
2011-06-16 13:11Zack GalbreathCategory => (No Category)
2016-08-12 09:55Kitware RobotNote Added: 0037125
2016-08-12 09:55Kitware RobotStatusexpired => closed
2016-08-12 09:55Kitware RobotResolutionopen => moved
2016-08-12 09:55Kitware RobotAssigned To => Kitware Robot

Notes
(0018819)
François Bertel   
2009-12-11 12:02   
Calling vtkOpenGLDisplayListPainter::ReleaseGraphicsResources(vtkWindow* win)
with a window not used by the vtkOpenGLDisplayListPainter is a bug in the caller code itself. There is no fix to add to vtkOpenGLDisplayListPainter::ReleaseGraphicsResources().

In addition, there is no guarantee that the "win" argument will then be a valid OpenGL context and any gl* call in this case will not be valid (it could lead to crash).

Maybe you can explain in which case it happens that "win" is not the one using the display list. It might still be a bug in VTK but somewhere else.
(0018844)
Xavi   
2009-12-14 09:34   
Hi Francois,

In my application I want to render several surface meshes in two windows. These are the objects involved:
- Two vtkWindows: to render the mesh in 3D. I can have other windows to render the mesh in 2D but now these are not important.
- One data object: vtkPolyData
- Two mappers for 3D: to render the mesh in 3D (vtkPolyDataMapper)

When the first mesh is loaded, the two mappers are created and attached to the mesh object. When the mesh is rendered in window 1, the mapper 1 is used. When the mesh object is deleted, the mappers are deleted.

Then, this process is repeated for the second mesh object.

When a mapper is deleted, there's a loop that iterates over all the vtkWindow and calls the function ReleaseGraphicsResources( ). Otherwise the OpenGL memory is not realeased until the vtkWindow is destroyed and the function wglDeleteContext( ) is called.

I hope you can get an overview of the context.

Best,
Xavi
(0037125)
Kitware Robot   
2016-08-12 09:55   
Resolving issue as `moved`.

This issue tracker is no longer used. Further discussion of this issue may take place in the current VTK Issues page linked in the banner at the top of this page.