From 4364a3fcae6b7994f3ee92811ce8d000dcb785ce Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Mon, 17 Mar 2014 18:18:28 +0300 Subject: Fix memory leak on window resize. --- src/render/nullopenglgraphics.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'src/render/nullopenglgraphics.cpp') diff --git a/src/render/nullopenglgraphics.cpp b/src/render/nullopenglgraphics.cpp index d09d7b13b..8782c9573 100644 --- a/src/render/nullopenglgraphics.cpp +++ b/src/render/nullopenglgraphics.cpp @@ -77,9 +77,12 @@ void NullOpenGLGraphics::initArrays() // need alocate small size, after if limit reached reallocate to double size vertexBufSize = mMaxVertices; const int sz = mMaxVertices * 4 + 30; - mFloatTexArray = new GLfloat[sz]; - mIntTexArray = new GLint[sz]; - mIntVertArray = new GLint[sz]; + if (!mFloatTexArray) + mFloatTexArray = new GLfloat[sz]; + if (!mIntTexArray) + mIntTexArray = new GLint[sz]; + if (!mIntVertArray) + mIntVertArray = new GLint[sz]; } bool NullOpenGLGraphics::setVideoMode(const int w, const int h, -- cgit v1.2.3-70-g09d2