From f6cb15f4101de0dd9196074c2fffd68de083ca33 Mon Sep 17 00:00:00 2001 From: twinaphex Date: Wed, 3 Jan 2018 13:59:15 +0100 Subject: [PATCH] Buildfix for HAVE_D3D8 --- gfx/common/d3d_common.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/gfx/common/d3d_common.c b/gfx/common/d3d_common.c index 1cfec09e1a..72c83b9f49 100644 --- a/gfx/common/d3d_common.c +++ b/gfx/common/d3d_common.c @@ -214,15 +214,16 @@ void d3d_surface_free(void *data) void d3d_vertex_declaration_free(void *data) { - LPDIRECT3DVERTEXDECLARATION vertex_decl = (LPDIRECT3DVERTEXDECLARATION)data; - if (!vertex_decl) + if (!data) return; #if defined(HAVE_D3D8) /* empty */ #elif defined(HAVE_D3D9) && !defined(__cplusplus) - IDirect3DVertexDeclaration9_Release(vertex_decl); + IDirect3DVertexDeclaration9_Release((LPDIRECT3DVERTEXDECLARATION)data); #else - vertex_decl->Release(); + LPDIRECT3DVERTEXDECLARATION vertex_decl = (LPDIRECDT3DVERTEXDECLARATION)data; + if (vertex_decl) + vertex_decl->Release(); #endif }