GS/DX11: Fix null texture related crashes when device creation fails.

Make sure null texture is initialized to null, otherwise if device creation fails early it causes issues when deleting the texture since it wasn't even created.
Also properly null it out after deletion.
This commit is contained in:
lightningterror
2026-09-26 16:32:21 +02:00
parent 9c1bea4ab6
commit 24eea4392c
2 changed files with 2 additions and 1 deletions
+1
View File
@@ -618,6 +618,7 @@ bool GSDevice11::Create(GSVSyncMode vsync_mode, bool allow_present_throttle)
void GSDevice11::Destroy()
{
delete m_null_texture;
m_null_texture = nullptr;
GSDevice::Destroy();
DestroySwapChain();
+1 -1
View File
@@ -140,7 +140,7 @@ private:
wil::com_ptr_nothrow<ID3D11ShaderResourceView> m_expand_vb_srv;
wil::com_ptr_nothrow<ID3D11ShaderResourceView> m_expand_ib_vs_srv;
GSTexture* m_null_texture;
GSTexture* m_null_texture = nullptr;
D3D_FEATURE_LEVEL m_feature_level = D3D_FEATURE_LEVEL_10_0;
u32 m_vb_pos = 0; // bytes