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

2006-10-15 Thread Stefan Dösinger
Hi > -> SetFVF()... sets FVF > -> GetVertexDeclaration() ... vdecl is null, but there is an FVF, grab > the FVF, and make a declaration out of it. Store the declaration, and > return it to the caller with refcount 1. > -> GetVertexDeclaration() again - just grab the stored declaration and > follow

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

2006-10-14 Thread Ivan Gyurdiev
Stefan Dösinger wrote: Am Samstag 14 Oktober 2006 20:53 schrieb Ivan Gyurdiev: H. Verbeet wrote: On 14/10/06, Ivan Gyurdiev <[EMAIL PROTECTED]> wrote: Exactly... so why is the refcount 1 *after* GetVertexDeclaration. Perhaps the declaration in only generated when calli

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

2006-10-14 Thread Stefan Dösinger
Am Samstag 14 Oktober 2006 20:53 schrieb Ivan Gyurdiev: > H. Verbeet wrote: > > On 14/10/06, Ivan Gyurdiev <[EMAIL PROTECTED]> wrote: > >> Exactly... so why is the refcount 1 *after* GetVertexDeclaration. > > > > Perhaps the declaration in only generated when calling > > GetVertexDeclaration(). If

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

2006-10-14 Thread Ivan Gyurdiev
H. Verbeet wrote: On 14/10/06, Ivan Gyurdiev <[EMAIL PROTECTED]> wrote: Exactly... so why is the refcount 1 *after* GetVertexDeclaration. Perhaps the declaration in only generated when calling GetVertexDeclaration(). If you call it twice, does it return the same pointer? No.. I tried that too.

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

2006-10-14 Thread H. Verbeet
On 14/10/06, Ivan Gyurdiev <[EMAIL PROTECTED]> wrote: Exactly... so why is the refcount 1 *after* GetVertexDeclaration. Perhaps the declaration in only generated when calling GetVertexDeclaration(). If you call it twice, does it return the same pointer?

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

2006-10-14 Thread Ivan Gyurdiev
H. Verbeet wrote: On 14/10/06, Ivan Gyurdiev <[EMAIL PROTECTED]> 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

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

2006-10-14 Thread H. Verbeet
On 14/10/06, Ivan Gyurdiev <[EMAIL PROTECTED]> 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 th

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

2006-10-13 Thread Ivan Gyurdiev
Ivan Gyurdiev wrote: Ivan Gyurdiev wrote: Karsten Elfenbein wrote: * don't prevent IUnknown_Release of pDecl in the exit section and fix for http://bugs.winehq.org/show_bug.cgi?id=5656 This seems wrong, d3d9 does not keep an internal reference of the vdecl. Try the attached patch instead, l

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

2006-10-07 Thread Ivan Gyurdiev
Ivan Gyurdiev wrote: Karsten Elfenbein wrote: * don't prevent IUnknown_Release of pDecl in the exit section and fix for http://bugs.winehq.org/show_bug.cgi?id=5656 This seems wrong, d3d9 does not keep an internal reference of the vdecl. Try the attached patch instead, let me know if it works

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

2006-10-07 Thread Ivan Gyurdiev
Karsten Elfenbein wrote: * don't prevent IUnknown_Release of pDecl in the exit section and fix for http://bugs.winehq.org/show_bug.cgi?id=5656 This seems wrong, d3d9 does not keep an internal reference of the vdecl. Try the attached patch instead, let me know if it works... --- dlls/d3d9/d3

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

2006-10-07 Thread H. Verbeet
On 07/10/06, Karsten Elfenbein <[EMAIL PROTECTED]> wrote: * don't prevent IUnknown_Release of pDecl in the exit section and fix for http://bugs.winehq.org/show_bug.cgi?id=5656 As mentioned on IRC, this can't work. Releasing the declaration there will cause it to be destroyed and break GetVertex