Skip to content

Commit

Permalink
[d3d9] Prevent device child refcount underrun
Browse files Browse the repository at this point in the history
  • Loading branch information
WinterSnowfall committed Nov 25, 2024
1 parent 0c45ccf commit 5515b9d
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/d3d9/d3d9_device_child.h
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit 5515b9d

Please sign in to comment.