d3d [1]: Remove AddRef from IWineD3DDevice_GetVertexDeclaration.

Markus Amsler markus.amsler at oribi.org
Mon Nov 27 18:47:34 CST 2006


H. Verbeet wrote:

> On 28/11/06, Markus Amsler <markus.amsler at oribi.org> wrote:
>> The following patches remove refcounting in wined3d Getters. The
>> Setters/Creaters refcounting can't be removed right now, because of the
>> way implicit surfaces are currently handled.
>>
>> The idea is to simplify the d3dx<->wined3d refcount relation. Ideally
>> every wined3d object gets created with refcount=1, never AddRef'ed and
>> destroyed with the first Release call. Rob mentioned this violates COM
>> rules, but wined3d is wine internal.
>>
>> The GetParent patch doesn't remove wined3d refcounting, it seperates
>> d3dx and wined3d refcounting (Which was the reason I started to remove
>> AddRefs).
>> ---
> I think this is a bad idea, if only for consistency with other COM
> objects. I don't think wined3d being wine internal is a very good
> reason to violate COM rules. IMO if we're going to use COM we should
> stick to its rules. Also see my other mail.

One problem is, half of the AddRef patches were commited. Before 
reverting them, I thought I send the rest again. The other problem is 
the AddRef in GetParent is ugly, because it AddRefs on a d3dx object. We 
should do d3dx refcounting only in d3dx. At least this one has to go, or 
the implicit surface refcount code gets ugly. That was why i removed all 
of them, to be consistent with GetParent.

And to be consistent with other COM objects (like ddraw, d3d8, d3d9), we 
would have to add some more ugly hacks :-) (like not destroying on count 
0, forward refcount of one object to another, ...)




More information about the wine-devel mailing list