Skip to content

Commit e2ad4c2

Browse files
committed
DStreams: Only delete buffers that have been allocated.
1 parent 4bbb6d8 commit e2ad4c2

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/Layers/xrRender/R_DStreams.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,8 @@ void _VertexStream::Create ()
4646
void _VertexStream::Destroy ()
4747
{
4848
#ifdef USE_OGL
49-
glDeleteBuffers(1, &pVB);
49+
if (pVB)
50+
glDeleteBuffers(1, &pVB);
5051
#else
5152
HW.stats_manager.decrement_stats_vb(pVB);
5253
_RELEASE(pVB);
@@ -217,7 +218,8 @@ void _IndexStream::Create ()
217218
void _IndexStream::Destroy()
218219
{
219220
#ifdef USE_OGL
220-
glDeleteBuffers(1, &pIB);
221+
if (pIB)
222+
glDeleteBuffers(1, &pIB);
221223
#else
222224
HW.stats_manager.decrement_stats_ib(pIB);
223225
_RELEASE(pIB);

0 commit comments

Comments
 (0)