From 0bf80bb9fc0532509a921477e6900b17cc78f5f4 Mon Sep 17 00:00:00 2001 From: Alex Szpakowski Date: Wed, 16 Sep 2015 22:28:22 -0300 Subject: [PATCH] Fixed a minor memory leak in love.graphics.setMode. --- src/modules/graphics/opengl/Graphics.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/modules/graphics/opengl/Graphics.cpp b/src/modules/graphics/opengl/Graphics.cpp index ca9427a7d..d80ce6356 100644 --- a/src/modules/graphics/opengl/Graphics.cpp +++ b/src/modules/graphics/opengl/Graphics.cpp @@ -294,6 +294,10 @@ bool Graphics::setMode(int width, int height) setDebug(enabledebug); + // Reload all volatile objects. + if (!Volatile::loadAll()) + ::printf("Could not reload all volatile objects.\n"); + // Create a quad indices object owned by love.graphics, so at least one // QuadIndices object is alive at all times while love.graphics is alive. // This makes sure there aren't too many expensive destruction/creations of @@ -302,10 +306,6 @@ bool Graphics::setMode(int width, int height) if (quadIndices == nullptr) quadIndices = new QuadIndices(20); - // Reload all volatile objects. - if (!Volatile::loadAll()) - ::printf("Could not reload all volatile objects.\n"); - // Restore the graphics state. restoreState(states.back());