mirror of
git://source.winehq.org/git/wine.git
synced 2024-11-01 02:46:32 +00:00
d3dx9: Skip AddRef + Release if SetValue is called with the old texture.
Signed-off-by: Matteo Bruni <mbruni@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
32ffef3333
commit
972dc565ed
1 changed files with 9 additions and 6 deletions
|
@ -1555,13 +1555,16 @@ static HRESULT d3dx9_base_effect_set_value(struct d3dx9_base_effect *base,
|
|||
case D3DXPT_TEXTURECUBE:
|
||||
for (i = 0; i < (param->element_count ? param->element_count : 1); ++i)
|
||||
{
|
||||
IUnknown *unk = ((IUnknown **)data)[i];
|
||||
if (unk)
|
||||
IUnknown_AddRef(unk);
|
||||
IUnknown *old_texture = ((IUnknown **)param->data)[i];
|
||||
IUnknown *new_texture = ((IUnknown **)data)[i];
|
||||
|
||||
unk = ((IUnknown **)param->data)[i];
|
||||
if (unk)
|
||||
IUnknown_Release(unk);
|
||||
if (new_texture == old_texture)
|
||||
continue;
|
||||
|
||||
if (new_texture)
|
||||
IUnknown_AddRef(new_texture);
|
||||
if (old_texture)
|
||||
IUnknown_Release(old_texture);
|
||||
}
|
||||
/* fallthrough */
|
||||
case D3DXPT_VOID:
|
||||
|
|
Loading…
Reference in a new issue