[D3D9] fix for SetFVF memleak [2nd try+patch]

H. Verbeet hverbeet at gmail.com
Sat Oct 14 04:09:54 CDT 2006

On 14/10/06, Ivan Gyurdiev <ivg231 at gmail.com> wrote:
> Ivan Gyurdiev wrote:
> >
> Based on further tests, I don't believe this patch is correct.. but it
> will fix the memory leak. I'm still unsure what kind of insanity the
> native API is doing internally - in process of figuring that out. When
> adding this code, I spent a lot of time testing conversion between the
> fvf and decl, and that has been shown to be correct - but management of
> the decl afterwards seems rather wrong to me now, and that it needs
> additional tests.
> Tests Show: Refcount of converted decl is 1 after GetVertexDeclaration()
> Tests Show: Refcount of converted decl *remains* 1 over a SetFVF call
> Tests Show: Refcount of converted decl *remains* 1 over a
> SetVertexDeclaration(NULL) call
That's what happens with regular declarations as well, see
test_get_set_vertex_declaration() in the d3d9 vertexdeclaration tests.
Calling SetVertexDeclaration() doesn't change the refcount, but
calling GetVertexDeclaration does (however,  note that wined3d
internally does change refcounts).

What does GetVertexDeclaration() do for the generated decl?

More information about the wine-devel mailing list