On 28/11/06, Markus Amsler markus.amsler@oribi.org wrote:
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.
Well, no. The basic rule there is that when a function produces a reference to an interface, it should AddRef that interface.
As for the previous patches, I was under the impression at the time that the idea was to get rid of COM in wined3d, otherwise I would have said something earlier. For consistency it would probably be best if they were reverted.
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, ...)
D3D does have some weird reference behaviour, but those should be the exceptions, not a reason to completely violate COM rules in the rest of the code.