direct3d: Release and NULL out vertex buffers on reset.

Otherwise they are irretrievably lost on window resize, etc, which makes
rendering freeze and other disasters.

Fixes Bugzilla #4358.
This commit is contained in:
Ryan C. Gordon 2018-12-02 20:55:57 -05:00
parent d4a21f54b8
commit 3c9361509b

View File

@ -1566,6 +1566,15 @@ D3D_Reset(SDL_Renderer * renderer)
}
}
/* Release all vertex buffers */
int i;
for (i = 0; i < SDL_arraysize(data->vertexBuffers); ++i) {
if (data->vertexBuffers[i]) {
IDirect3DVertexBuffer9_Release(data->vertexBuffers[i]);
}
data->vertexBuffers[i] = NULL;
}
result = IDirect3DDevice9_Reset(data->device, &data->pparams);
if (FAILED(result)) {
if (result == D3DERR_DEVICELOST) {