From dfedaee353ccbf4dcfcfd3eb4024e0dd8e9b4b69 Mon Sep 17 00:00:00 2001 From: aap Date: Fri, 1 May 2020 14:20:02 +0200 Subject: [PATCH] little fix for d3d --- src/d3d/d3ddevice.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/d3d/d3ddevice.cpp b/src/d3d/d3ddevice.cpp index 476a0e2..21ae6e2 100644 --- a/src/d3d/d3ddevice.cpp +++ b/src/d3d/d3ddevice.cpp @@ -909,7 +909,11 @@ static void releaseDynamicVBs(void) { DynamicVB *dvb; + int i; for(dvb = dynamicVBs; dvb; dvb = dvb->next){ + for(i = 0; i < MAXNUMSTREAMS; i++) + if(deviceCache.vertexStreams[i].buffer == *dvb->buf) + deviceCache.vertexStreams[i].buffer = nil; destroyVertexBuffer(*dvb->buf); *dvb->buf = nil; } @@ -955,6 +959,8 @@ releaseDynamicIBs(void) { DynamicIB *ivb; for(ivb = dynamicIBs; ivb; ivb = ivb->next){ + if(deviceCache.indices == *ivb->buf) + deviceCache.indices = nil; destroyIndexBuffer(*ivb->buf); *ivb->buf = nil; }