diff options
author | Andrei Karas <akaras@inbox.ru> | 2014-03-17 18:18:28 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2014-03-17 18:18:28 +0300 |
commit | 4364a3fcae6b7994f3ee92811ce8d000dcb785ce (patch) | |
tree | 6b7012061d7dd4f36b8ae020de1a85586c91d611 /src/render/nullopenglgraphics.cpp | |
parent | fa69d82536fbe9b9b7763ae8a106f59757bec116 (diff) | |
download | mv-4364a3fcae6b7994f3ee92811ce8d000dcb785ce.tar.gz mv-4364a3fcae6b7994f3ee92811ce8d000dcb785ce.tar.bz2 mv-4364a3fcae6b7994f3ee92811ce8d000dcb785ce.tar.xz mv-4364a3fcae6b7994f3ee92811ce8d000dcb785ce.zip |
Fix memory leak on window resize.
Diffstat (limited to 'src/render/nullopenglgraphics.cpp')
-rw-r--r-- | src/render/nullopenglgraphics.cpp | 9 |
1 files changed, 6 insertions, 3 deletions
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, |