d3d9: Release the vertex declaration once we're done with it.
authorHenri Verbeet <hverbeet@codeweavers.com>
Mon, 29 Dec 2008 08:14:28 +0000 (09:14 +0100)
committerAlexandre Julliard <julliard@winehq.org>
Mon, 29 Dec 2008 11:16:27 +0000 (12:16 +0100)
dlls/d3d9/device.c

index d8c6e58ae7da84c2a260f861efbc6f3164c39831..9133fad47ae7566d13355eb4c3e96d585e4c1ca7 100644 (file)
@@ -1333,7 +1333,16 @@ static HRESULT WINAPI IDirect3DDevice9Impl_GetFVF(LPDIRECT3DDEVICE9EX iface, DWO
         return hr;
     }
 
-    *pFVF = decl ? ((IDirect3DVertexDeclaration9Impl *)decl)->convFVF : 0;
+    if (decl)
+    {
+        *pFVF = ((IDirect3DVertexDeclaration9Impl *)decl)->convFVF;
+        IDirect3DVertexDeclaration9_Release(decl);
+    }
+    else
+    {
+        *pFVF = 0;
+    }
+
     TRACE("Returning FVF %#x\n", *pFVF);
 
     return hr;