From 4b8a6d93c5a785c673ec6c9f8a09880c48dee065 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Fri, 13 Jun 2014 23:51:20 +0300 Subject: Fix crash with software renderer. --- src/graphicsvertexes.cpp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'src') 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) -- cgit v1.2.3-70-g09d2