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

[util,d3d11] Be more robust against use-after-free

Sims 4 binds an SRV after destroying it, so we need to ensure our internal
view pointers are null or we'll create a problem otherwise.
This commit is contained in:
Philip Rebohle 2024-09-02 21:50:42 +02:00
parent 04d558cf2e
commit 427e706a40
6 changed files with 6 additions and 0 deletions

View File

@ -106,6 +106,7 @@ namespace dxvk {
D3D11DepthStencilView::~D3D11DepthStencilView() {
ResourceReleasePrivate(m_resource);
m_resource = nullptr;
}

View File

@ -116,6 +116,7 @@ namespace dxvk {
D3D11RenderTargetView::~D3D11RenderTargetView() {
ResourceReleasePrivate(m_resource);
m_resource = nullptr;
}

View File

@ -183,6 +183,7 @@ namespace dxvk {
D3D11ShaderResourceView::~D3D11ShaderResourceView() {
ResourceReleasePrivate(m_resource);
m_resource = nullptr;
}

View File

@ -129,6 +129,7 @@ namespace dxvk {
D3D11UnorderedAccessView::~D3D11UnorderedAccessView() {
ResourceReleasePrivate(m_resource);
m_resource = nullptr;
}

View File

@ -96,6 +96,7 @@ namespace dxvk {
~Com() {
this->decRef();
m_ptr = nullptr;
}
T* operator -> () const {

View File

@ -86,6 +86,7 @@ namespace dxvk {
~Rc() {
this->decRef();
m_object = nullptr;
}
T& operator * () const { return *m_object; }