Skip to content

Commit

Permalink
Fix resource leak after calling "IDirect3DDevice8::GetTexture" (#175)
Browse files Browse the repository at this point in the history
  • Loading branch information
elishacloud authored Sep 11, 2024
1 parent 18bce66 commit ac41b09
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions source/d3d8to9_device.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -863,16 +863,20 @@ HRESULT STDMETHODCALLTYPE Direct3DDevice8::GetTexture(DWORD Stage, IDirect3DBase
case D3DRTYPE_TEXTURE:
BaseTextureInterface->QueryInterface(IID_PPV_ARGS(&TextureInterface));
*ppTexture = ProxyAddressLookupTable->FindAddress<Direct3DTexture8>(TextureInterface);
BaseTextureInterface->Release();
break;
case D3DRTYPE_VOLUMETEXTURE:
BaseTextureInterface->QueryInterface(IID_PPV_ARGS(&VolumeTextureInterface));
*ppTexture = ProxyAddressLookupTable->FindAddress<Direct3DVolumeTexture8>(VolumeTextureInterface);
BaseTextureInterface->Release();
break;
case D3DRTYPE_CUBETEXTURE:
BaseTextureInterface->QueryInterface(IID_PPV_ARGS(&CubeTextureInterface));
*ppTexture = ProxyAddressLookupTable->FindAddress<Direct3DCubeTexture8>(CubeTextureInterface);
BaseTextureInterface->Release();
break;
default:
BaseTextureInterface->Release();
return D3DERR_INVALIDCALL;
}
}
Expand Down

0 comments on commit ac41b09

Please sign in to comment.