From 92b4a902da05be02433025b9ab81d21fdd8a84af Mon Sep 17 00:00:00 2001 From: bkaradzic Date: Wed, 4 Jul 2012 17:37:12 -0700 Subject: [PATCH] Release everyting on shutdown. --- src/renderer_d3d9.cpp | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/src/renderer_d3d9.cpp b/src/renderer_d3d9.cpp index 556a2b9e..3f84c61f 100644 --- a/src/renderer_d3d9.cpp +++ b/src/renderer_d3d9.cpp @@ -340,6 +340,41 @@ namespace bgfx { preReset(); + for (uint32_t ii = 0; ii < countof(m_indexBuffers); ++ii) + { + m_indexBuffers[ii].destroy(); + } + + for (uint32_t ii = 0; ii < countof(m_vertexBuffers); ++ii) + { + m_vertexBuffers[ii].destroy(); + } + + for (uint32_t ii = 0; ii < countof(m_vertexShaders); ++ii) + { + m_vertexShaders[ii].destroy(); + } + + for (uint32_t ii = 0; ii < countof(m_fragmentShaders); ++ii) + { + m_fragmentShaders[ii].destroy(); + } + + for (uint32_t ii = 0; ii < countof(m_textures); ++ii) + { + m_textures[ii].destroy(); + } + + for (uint32_t ii = 0; ii < countof(m_vertexDecls); ++ii) + { + m_vertexDecls[ii].destroy(); + } + + for (uint32_t ii = 0; ii < countof(m_renderTargets); ++ii) + { + m_renderTargets[ii].destroy(); + } + DX_RELEASE(m_device, 0); DX_RELEASE(m_d3d9, 0);