From 93fed31e3a2b0e6f1e3b4874c0340fe45b21791c Mon Sep 17 00:00:00 2001 From: twinaphex Date: Fri, 8 Jan 2016 20:51:30 +0100 Subject: [PATCH] N/A --- gfx/common/d3d_common.cpp | 1 - gfx/d3d/d3d.cpp | 4 +++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/gfx/common/d3d_common.cpp b/gfx/common/d3d_common.cpp index f7c743113b..74df2926c0 100644 --- a/gfx/common/d3d_common.cpp +++ b/gfx/common/d3d_common.cpp @@ -79,7 +79,6 @@ void d3d_texture_free(LPDIRECT3DTEXTURE tex) { if (tex) tex->Release(); - tex = NULL; } bool d3d_vertex_declaration_new(LPDIRECT3DDEVICE dev, diff --git a/gfx/d3d/d3d.cpp b/gfx/d3d/d3d.cpp index 106b2ba014..7de8f4deee 100644 --- a/gfx/d3d/d3d.cpp +++ b/gfx/d3d/d3d.cpp @@ -1782,10 +1782,12 @@ static uintptr_t d3d_load_texture(void *video_data, void *data, static void d3d_unload_texture(void *data, uintptr_t *id) { + LPDIRECT3DTEXTURE texid = (LPDIRECT3DTEXTURE)id; if (!id) return; - d3d_texture_free((LPDIRECT3DTEXTURE)id); + d3d_texture_free(texid); + *id = NULL; } static const video_poke_interface_t d3d_poke_interface = {