1
0
mirror of https://github.com/EduApps-CDG/OpenDX synced 2024-12-30 09:45:37 +01:00

[com] Fixed crashes caused by reentrant Release()

This commit is contained in:
Philip Rebohle 2017-12-09 22:20:40 +01:00
parent 2b86a2f1f3
commit fa1ef8248e

View File

@ -12,7 +12,7 @@
return S_OK; \ return S_OK; \
} \ } \
} while (0) } while (0)
#include <iostream>
namespace dxvk { namespace dxvk {
template<typename... Base> template<typename... Base>
@ -28,8 +28,10 @@ namespace dxvk {
ULONG Release() { ULONG Release() {
ULONG refCount = --m_refCount; ULONG refCount = --m_refCount;
if (refCount == 0) if (refCount == 0) {
refCount += 0x80000000u;
delete this; delete this;
}
return refCount; return refCount;
} }