Permalink
Browse files

BUG: Fix bug leaking OpenGL resources when actors are removed.

Change-Id: Ib4697b9465d555d510d9ee835f3e907daadb4a06
  • Loading branch information...
1 parent 99b9af8 commit 02aac437718c9f61f2177b2c6c6a229ccc673fc3 @clintonstimpson clintonstimpson committed Apr 26, 2012
Showing with 4 additions and 0 deletions.
  1. +2 −0 GUISupport/Qt/QVTKGraphicsItem.cxx
  2. +2 −0 GUISupport/Qt/QVTKWidget2.cxx
@@ -59,6 +59,7 @@ void QVTKGraphicsItem::SetRenderWindow(vtkGenericOpenGLRenderWindow* win)
{
if(mWin)
{
+ mWin->SetMapped(0);
mConnect->Disconnect(mWin, vtkCommand::StartEvent, this, SLOT(Start()));
mConnect->Disconnect(mWin, vtkCommand::WindowMakeCurrentEvent, this, SLOT(MakeCurrent()));
mConnect->Disconnect(mWin, vtkCommand::EndEvent, this, SLOT(End()));
@@ -74,6 +75,7 @@ void QVTKGraphicsItem::SetRenderWindow(vtkGenericOpenGLRenderWindow* win)
if(mWin)
{
+ mWin->SetMapped(1);
mWin->SetDoubleBuffer(0);
mWin->SetFrontBuffer(vtkgl::COLOR_ATTACHMENT0_EXT);
mWin->SetFrontLeftBuffer(vtkgl::COLOR_ATTACHMENT0_EXT);
@@ -137,6 +137,7 @@ void QVTKWidget2::SetRenderWindow(vtkGenericOpenGLRenderWindow* w)
if(this->mRenWin)
{
this->mRenWin->Finalize();
+ this->mRenWin->SetMapped(0);
mConnect->Disconnect(mRenWin, vtkCommand::WindowMakeCurrentEvent, this, SLOT(MakeCurrent()));
mConnect->Disconnect(mRenWin, vtkCommand::WindowIsCurrentEvent, this, SLOT(IsCurrent(vtkObject*, unsigned long, void*, void*)));
mConnect->Disconnect(mRenWin, vtkCommand::WindowFrameEvent, this, SLOT(Frame()));
@@ -153,6 +154,7 @@ void QVTKWidget2::SetRenderWindow(vtkGenericOpenGLRenderWindow* w)
{
// if it is mapped somewhere else, unmap it
this->mRenWin->Finalize();
+ this->mRenWin->SetMapped(1);
// tell the vtk window what the size of this window is
this->mRenWin->SetSize(this->width(), this->height());

0 comments on commit 02aac43

Please sign in to comment.