mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-09 04:38:03 +02:00
d3d1x: fix refcounting of GalliumD3D11DeviceChild objects
An external Release would have lowered the device reference count, but an internal reference in the context does not raise it (by design).
This commit is contained in:
parent
3fc2818f2b
commit
cb88426293
1 changed files with 6 additions and 2 deletions
|
|
@ -42,6 +42,12 @@ struct GalliumD3D11DeviceChild : public GalliumPrivateDataComObject<Base, dual_r
|
|||
device->AddRef();
|
||||
}
|
||||
|
||||
virtual ~GalliumD3D11DeviceChild()
|
||||
{
|
||||
if(device)
|
||||
device->Release();
|
||||
}
|
||||
|
||||
/* The purpose of this is to avoid cyclic garbage, since this won't hold
|
||||
* a pointer to the device if it is only held by a pipeline binding in the immediate context
|
||||
*
|
||||
|
|
@ -50,13 +56,11 @@ struct GalliumD3D11DeviceChild : public GalliumPrivateDataComObject<Base, dual_r
|
|||
*/
|
||||
inline ULONG add_ref()
|
||||
{
|
||||
device->AddRef();
|
||||
return GalliumPrivateDataComObject<Base, dual_refcnt_t>::add_ref();
|
||||
}
|
||||
|
||||
inline ULONG release()
|
||||
{
|
||||
device->Release();
|
||||
return GalliumPrivateDataComObject<Base, dual_refcnt_t>::release();
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue