Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Offscreen rendering segfault [ Win32/OpenGL ]
Attempt to fix the segfault occuring after using offscreen rendering
on Windows using the OpenGL backend.
  • Loading branch information
Eloi Gaudry committed Feb 9, 2017
1 parent c7023e5 commit 49802a3
Showing 1 changed file with 3 additions and 17 deletions.
20 changes: 3 additions & 17 deletions Rendering/OpenGL/vtkWin32OpenGLRenderWindow.cxx
Expand Up @@ -155,6 +155,7 @@ void vtkWin32OpenGLRenderWindow::CleanUpRenderers()
(ren = this->Renderers->GetNextRenderer(rsit));)
{
ren->SetRenderWindow(NULL);
ren->SetRenderWindow(this);
}
}

Expand Down Expand Up @@ -1528,14 +1529,7 @@ void vtkWin32OpenGLRenderWindow::CreateOffScreenDC(HBITMAP hbmp, HDC aHdc)
GetObject(hbmp, sizeof(BITMAP), &bm);

// Renderers will need to redraw anything cached in display lists
vtkRenderer *ren;
vtkCollectionSimpleIterator rsit;
this->Renderers->InitTraversal(rsit);
while ((ren = this->Renderers->GetNextRenderer(rsit)))
{
ren->SetRenderWindow(NULL);
ren->SetRenderWindow(this);
}
this->CleanUpRenderers();

this->MemoryBuffer = hbmp;

Expand Down Expand Up @@ -1639,15 +1633,7 @@ void vtkWin32OpenGLRenderWindow::ResumeScreenRendering(void)
if (this->ContextId!=0)
{
this->MakeCurrent();
// Renderers will need to redraw anything cached in display lists
vtkRenderer *ren;
vtkCollectionSimpleIterator rsit;
this->Renderers->InitTraversal(rsit);
while ((ren = this->Renderers->GetNextRenderer(rsit)))
{
ren->SetRenderWindow(NULL);
ren->SetRenderWindow(this);
}
this->CleanUpRenderers();
}

if (this->MemoryBuffer)
Expand Down

0 comments on commit 49802a3

Please sign in to comment.