Browse Source

Fixed love.graphics.newScreenshot potentially deleting any active Canvases.

Alex Szpakowski 11 years ago
parent
commit
191b910f23
1 changed files with 2 additions and 2 deletions
  1. 2 2
      src/modules/graphics/opengl/Graphics.cpp

+ 2 - 2
src/modules/graphics/opengl/Graphics.cpp

@@ -170,7 +170,7 @@ void Graphics::setViewportSize(int width, int height)
 
 	// We want to affect the main screen, not any Canvas that's currently active
 	// (not that any *should* be active when this is called.)
-	std::vector<Canvas *> canvases = getCanvas();
+	std::vector<Object::StrongRef<Canvas>> canvases = states.back().canvases;
 	setCanvas();
 
 	// Set the viewport to top-left corner.
@@ -1075,7 +1075,7 @@ love::image::ImageData *Graphics::newScreenshot(love::image::Image *image, bool
 {
 	// Temporarily unbind the currently active canvas (glReadPixels reads the
 	// active framebuffer, not the main one.)
-	std::vector<Canvas *> canvases = getCanvas();
+	std::vector<Object::StrongRef<Canvas>> canvases = states.back().canvases;
 	setCanvas();
 
 	int w = getWidth();