diff options
author | Andrei Karas <akaras@inbox.ru> | 2014-06-13 23:51:20 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2014-06-13 23:51:38 +0300 |
commit | 4b8a6d93c5a785c673ec6c9f8a09880c48dee065 (patch) | |
tree | 4766d4fb6f25e38070b502cb90b0df70dd1bcee8 /src/graphicsvertexes.cpp | |
parent | 487b75ecdf1b6ea327d6a636ce186b393049d21f (diff) | |
download | manaverse-4b8a6d93c5a785c673ec6c9f8a09880c48dee065.tar.gz manaverse-4b8a6d93c5a785c673ec6c9f8a09880c48dee065.tar.bz2 manaverse-4b8a6d93c5a785c673ec6c9f8a09880c48dee065.tar.xz manaverse-4b8a6d93c5a785c673ec6c9f8a09880c48dee065.zip |
Fix crash with software renderer.
Diffstat (limited to 'src/graphicsvertexes.cpp')
-rw-r--r-- | src/graphicsvertexes.cpp | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/graphicsvertexes.cpp b/src/graphicsvertexes.cpp index 297762146..c632952ee 100644 --- a/src/graphicsvertexes.cpp +++ b/src/graphicsvertexes.cpp @@ -97,8 +97,15 @@ void OpenGLGraphicsVertexes::clear() } mIntTexPool.clear(); - mglDeleteBuffers(mVbo.size(), &mVbo[0]); - mVbo.clear(); + if (mglDeleteBuffers) + { + const int sz = mVbo.size(); + if (sz > 0) + { + mglDeleteBuffers(sz, &mVbo[0]); + mVbo.clear(); + } + } mVp.clear(); if (ptr) |