fix some D3D memory leaks

git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@5127 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
donkopunchstania 2010-02-25 03:14:40 +00:00
parent aa1081348d
commit 4915097d93
2 changed files with 16 additions and 1 deletions

View File

@ -320,7 +320,16 @@ HRESULT Create(int adapter, HWND wnd, bool _fullscreen, int _resolution, int aa_
void Close()
{
dev->Release();
if (back_buffer_z)
back_buffer_z->Release();
back_buffer_z = NULL;
back_buffer->Release();
back_buffer = NULL;
ULONG references = dev->Release();
if (references)
ERROR_LOG(VIDEO, "Unreleased references: %i.", references);
dev = 0;
}

View File

@ -247,9 +247,15 @@ void VertexShaderCache::Shutdown()
if (SimpleVertexShader)
SimpleVertexShader->Release();
SimpleVertexShader = NULL;
if (ClearVertexShader)
ClearVertexShader->Release();
ClearVertexShader = NULL;
if (FSAAVertexShader)
FSAAVertexShader->Release();
FSAAVertexShader = NULL;
Clear();
g_vs_disk_cache.Sync();
g_vs_disk_cache.Close();