title: vtk offscreen rendering crash
body: <p>I am working on an application with VTK windows. (my VTK version is 5.8.0)</p>
  
  <p>Leaving "VTK render window", all other windows are hidden.
  But it is necessary to render the hidden windows because the rendered images of the hidden windows are needed to be stored as images.</p>
  
  <p>here is sample code.</p>
  
  <pre><code>std::vector&lt;vtkRenderer*&gt; renderers;
  renderers.reserve(m_numberOfRenderer);   // m_numberOfRenderer = 4
  
  std::vector&lt;vtkRenderWindow*&gt; windows;
  windows.reserve(m_numberOfRenderer);
  
  for(int i=0; i&lt;m_numberOfRenderer; i++)
  {
      vtkRenderer* renderer = vtkRenderer::New();
      vtkRenderWindow* window = vtkRenderWindow::New();
      renderer-&gt;TwoSidedLightingOff();
  
      window-&gt;OffScreenRenderingOn();
      window-&gt;SetSize(m_width, m_height);
      window-&gt;AddRenderer(renderer);
  
      renderer-&gt;SetActiveCamera(m_renderCamera.at(i));
      renderer-&gt;AddActor(m_actor.at(i));
      renderer-&gt;AddActor(m_outActor.at(i));
  
      renderers.push_back(renderer);
      windows.push_back(window);
  }
  </code></pre>
  
  <p>My code is working fine but sometimes crashes on <code>OffScreenRenderingOn</code> method</p>
  
  <p>THIS IS VTK CLASS REF  ---   <a href="http://www.vtk.org/doc/nightly/html/classvtkWindow.html#a25c2cd7f6dad61d91f148da42bc8e780" rel="nofollow">http://www.vtk.org/doc/nightly/html/classvtkWindow.html#a25c2cd7f6dad61d91f148da42bc8e780</a>)</p>
  
  <pre><code>virtual void vtkWindow::OffScreenRenderingOn()
  </code></pre>
  
  <p>Creates a window in memory instead of on the screen. This may not be supported for every type of window and on <strong>some windows you may need to invoke this prior to the first render.</strong></p>
  
  <p>i don't know that some windows you may need to invoke this prior to the first render.</p>
  
  <p>i appreciate any help,</p>
  
  <p>Thanks in advance</p>