1
0
mirror of https://github.com/doitsujin/dxvk.git synced 2024-11-29 01:24:11 +01:00

[d3d9] Prevent device child refcount underrun

This commit is contained in:
WinterSnowfall 2024-11-26 00:16:04 +02:00
parent 0c45ccf96c
commit 5515b9d9b3
No known key found for this signature in database

View File

@ -25,6 +25,10 @@ namespace dxvk {
}
ULONG STDMETHODCALLTYPE Release() {
// ignore Release calls on objects with 0 refCount
if(unlikely(!this->m_refCount))
return this->m_refCount;
uint32_t refCount = --this->m_refCount;
if (unlikely(!refCount)) {
auto* pDevice = GetDevice();