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/mobileopenglgraphics.cpp | |
parent | fa69d82536fbe9b9b7763ae8a106f59757bec116 (diff) | |
download | manaplus-4364a3fcae6b7994f3ee92811ce8d000dcb785ce.tar.gz manaplus-4364a3fcae6b7994f3ee92811ce8d000dcb785ce.tar.bz2 manaplus-4364a3fcae6b7994f3ee92811ce8d000dcb785ce.tar.xz manaplus-4364a3fcae6b7994f3ee92811ce8d000dcb785ce.zip |
Fix memory leak on window resize.
Diffstat (limited to 'src/render/mobileopenglgraphics.cpp')
-rw-r--r-- | src/render/mobileopenglgraphics.cpp | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/src/render/mobileopenglgraphics.cpp b/src/render/mobileopenglgraphics.cpp index 86707fac8..c815d096d 100644 --- a/src/render/mobileopenglgraphics.cpp +++ b/src/render/mobileopenglgraphics.cpp @@ -113,10 +113,14 @@ void MobileOpenGLGraphics::initArrays() // need alocate small size, after if limit reached reallocate to double size const int sz = mMaxVertices * 4 + 30; vertexBufSize = mMaxVertices; - mFloatTexArray = new GLfloat[sz]; - mShortVertArray = new GLshort[sz]; - mFloatTexArrayCached = new GLfloat[sz]; - mShortVertArrayCached = new GLshort[sz]; + if (!mFloatTexArray) + mFloatTexArray = new GLfloat[sz]; + if (!mShortVertArray) + mShortVertArray = new GLshort[sz]; + if (!mFloatTexArrayCached) + mFloatTexArrayCached = new GLfloat[sz]; + if (!mShortVertArrayCached) + mShortVertArrayCached = new GLshort[sz]; } bool MobileOpenGLGraphics::setVideoMode(const int w, const int h, |