From 3f5a42adc6d473dc47fb6f8bf3a03f387ff3b90c Mon Sep 17 00:00:00 2001 From: Glenn Maynard Date: Sat, 5 Nov 2005 16:48:35 +0000 Subject: [PATCH] fix texture leak. D3D has the best response to these reference leaks ever: on shutdown, some part of window closing or screen mode resetting will freeze for about five seconds, depending on the window mode. No indication why is given. --- stepmania/src/RageDisplay_D3D.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/stepmania/src/RageDisplay_D3D.cpp b/stepmania/src/RageDisplay_D3D.cpp index 88af307ead..61782cf64b 100644 --- a/stepmania/src/RageDisplay_D3D.cpp +++ b/stepmania/src/RageDisplay_D3D.cpp @@ -795,10 +795,11 @@ void RageDisplay_D3D::SendCurrentMatrices() g_pd3dDevice->SetTextureStageState( tu, D3DTSS_TEXTURETRANSFORMFLAGS, D3DTTFF_COUNT2 ); // If no texture is set for this texture unit, don't bother setting it up. - IDirect3DBaseTexture8* ppTexture = NULL; - g_pd3dDevice->GetTexture( g_currentTextureUnit, &ppTexture ); - if( ppTexture == NULL ) + IDirect3DBaseTexture8* pTexture = NULL; + g_pd3dDevice->GetTexture( g_currentTextureUnit, &pTexture ); + if( pTexture == NULL ) continue; + pTexture->Release(); if( g_bSphereMapping[tu] )