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

This commit is contained in:
Alex Szpakowski
2014-08-08 18:49:11 -03:00
parent 30ff7d4659
commit 191b910f23
+2 -2
View File
@@ -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 // We want to affect the main screen, not any Canvas that's currently active
// (not that any *should* be active when this is called.) // (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(); setCanvas();
// Set the viewport to top-left corner. // 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 // Temporarily unbind the currently active canvas (glReadPixels reads the
// active framebuffer, not the main one.) // active framebuffer, not the main one.)
std::vector<Canvas *> canvases = getCanvas(); std::vector<Object::StrongRef<Canvas>> canvases = states.back().canvases;
setCanvas(); setCanvas();
int w = getWidth(); int w = getWidth();