mirror of
https://github.com/PCSX2/pcsx2.git
synced 2026-10-12 02:08:45 +00:00
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:
@@ -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();
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user