Skip to content

Commit

Permalink
DStreams: Only delete buffers that have been allocated.
Browse files Browse the repository at this point in the history
  • Loading branch information
CrossVR committed Nov 27, 2015
1 parent 4bbb6d8 commit e2ad4c2
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/Layers/xrRender/R_DStreams.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,8 @@ void _VertexStream::Create ()
void _VertexStream::Destroy ()
{
#ifdef USE_OGL
glDeleteBuffers(1, &pVB);
if (pVB)
glDeleteBuffers(1, &pVB);
#else
HW.stats_manager.decrement_stats_vb(pVB);
_RELEASE(pVB);
Expand Down Expand Up @@ -217,7 +218,8 @@ void _IndexStream::Create ()
void _IndexStream::Destroy()
{
#ifdef USE_OGL
glDeleteBuffers(1, &pIB);
if (pIB)
glDeleteBuffers(1, &pIB);
#else
HW.stats_manager.decrement_stats_ib(pIB);
_RELEASE(pIB);
Expand Down

0 comments on commit e2ad4c2

Please sign in to comment.