summaryrefslogtreecommitdiff
path: root/src/render
diff options
context:
space:
mode:
Diffstat (limited to 'src/render')
-rw-r--r--src/render/mobileopenglgraphics.cpp4
-rw-r--r--src/render/normalopenglgraphics.cpp4
-rw-r--r--src/render/safeopenglgraphics.cpp4
3 files changed, 6 insertions, 6 deletions
diff --git a/src/render/mobileopenglgraphics.cpp b/src/render/mobileopenglgraphics.cpp
index 91184958b..ce930f416 100644
--- a/src/render/mobileopenglgraphics.cpp
+++ b/src/render/mobileopenglgraphics.cpp
@@ -906,7 +906,7 @@ SDL_Surface* MobileOpenGLGraphics::getScreenshot()
SDL_LockSurface(screenshot);
const unsigned int lineSize = 3 * w;
- GLubyte *const buf = static_cast<GLubyte*>(malloc(lineSize));
+ GLubyte *const buf = new GLubyte[lineSize];
if (!buf)
return nullptr;
@@ -929,7 +929,7 @@ SDL_Surface* MobileOpenGLGraphics::getScreenshot()
memcpy(bot, buf, lineSize);
}
- free(buf);
+ delete [] buf;
if (config.getBoolValue("usefbo"))
graphicsManager.deleteFBO(&mFbo);
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);
diff --git a/src/render/safeopenglgraphics.cpp b/src/render/safeopenglgraphics.cpp
index cd3338188..1daf054ba 100644
--- a/src/render/safeopenglgraphics.cpp
+++ b/src/render/safeopenglgraphics.cpp
@@ -449,7 +449,7 @@ SDL_Surface* SafeOpenGLGraphics::getScreenshot()
// Flip the screenshot, as OpenGL has 0,0 in bottom left
unsigned int lineSize = 3 * w;
- GLubyte* buf = static_cast<GLubyte*>(malloc(lineSize));
+ GLubyte* buf = new GLubyte[lineSize];
const int h2 = h / 2;
for (int i = 0; i < h2; i++)
@@ -464,7 +464,7 @@ SDL_Surface* SafeOpenGLGraphics::getScreenshot()
memcpy(bot, buf, lineSize);
}
- free(buf);
+ delete [] buf;
if (config.getBoolValue("usefbo"))
graphicsManager.deleteFBO(&mFbo);