Commit 02aac437 authored by Clinton Stimpson's avatar Clinton Stimpson
Browse files

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

Change-Id: Ib4697b9465d555d510d9ee835f3e907daadb4a06
parent 99b9af87
......@@ -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());
......
Supports Markdown
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