summaryrefslogtreecommitdiff
path: root/src/render/normalopenglgraphics.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/render/normalopenglgraphics.cpp')
-rw-r--r--src/render/normalopenglgraphics.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/render/normalopenglgraphics.cpp b/src/render/normalopenglgraphics.cpp
index 4222051ea..fd5568b87 100644
--- a/src/render/normalopenglgraphics.cpp
+++ b/src/render/normalopenglgraphics.cpp
@@ -1124,7 +1124,7 @@ SDL_Surface* NormalOpenGLGraphics::getScreenshot()
// Flip the screenshot, as OpenGL has 0,0 in bottom left
const unsigned int lineSize = 3 * w;
- GLubyte *const buf = static_cast<GLubyte *const>(malloc(lineSize));
+ GLubyte *const buf = new GLubyte[lineSize];
const int h2 = h / 2;
for (int i = 0; i < h2; i++)
@@ -1139,7 +1139,7 @@ SDL_Surface* NormalOpenGLGraphics::getScreenshot()
memcpy(bot, buf, lineSize);
}
- free(buf);
+ delete [] buf;
if (config.getBoolValue("usefbo"))
graphicsManager.deleteFBO(&mFbo);