GSdx: more leak cleanup

git-svn-id: http://pcsx2.googlecode.com/svn/trunk@1466 96395faa-99c1-11dd-bbfe-3dabce05a288
This commit is contained in:
gabest11 2009-07-04 22:54:57 +00:00
parent 6eed14ae75
commit ae62a56cc1
8 changed files with 21 additions and 5 deletions

View File

@ -32,6 +32,7 @@ GPURendererSW::GPURendererSW(GSDevice* dev)
GPURendererSW::~GPURendererSW()
{
delete m_texture;
}
void GPURendererSW::ResetDevice()

View File

@ -25,6 +25,7 @@ template<int i> class GSAlignedClass
{
public:
GSAlignedClass() {}
virtual ~GSAlignedClass() {}
void* operator new (size_t size)
{

View File

@ -90,12 +90,12 @@ bool GSDevice9::Create(GSWnd* wnd, bool vsync)
// d3d
m_d3d = Direct3DCreate9(D3D_SDK_VERSION);
m_d3d.Attach(Direct3DCreate9(D3D_SDK_VERSION));
if(!m_d3d) return false;
hr = m_d3d->CheckDeviceFormat(D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, D3DFMT_X8R8G8B8, D3DUSAGE_DEPTHSTENCIL, D3DRTYPE_SURFACE, D3DFMT_D24S8);
if(FAILED(hr)) return false;
hr = m_d3d->CheckDepthStencilMatch(D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, D3DFMT_X8R8G8B8, D3DFMT_X8R8G8B8, D3DFMT_D24S8);
@ -194,8 +194,6 @@ bool GSDevice9::Reset(int w, int h, int mode)
HRESULT hr;
if(!m_d3d) return false;
if(mode == DontCare)
{
mode = m_pp.Windowed ? Windowed : Fullscreen;

View File

@ -92,6 +92,7 @@ private:
DDCAPS m_ddcaps;
D3DCAPS9 m_d3dcaps;
D3DPRESENT_PARAMETERS m_pp;
CComPtr<IDirect3D9> m_d3d;
CComPtr<IDirect3DDevice9> m_dev;
CComPtr<IDirect3DSwapChain9> m_swapchain;
@ -104,7 +105,6 @@ private:
} m_vertices;
public: // TODO
D3DPRESENT_PARAMETERS m_pp;
struct
{

View File

@ -45,6 +45,11 @@ GSRenderer::GSRenderer(uint8* base, bool mt, void (*irq)(), GSDevice* dev)
GSRenderer::~GSRenderer()
{
if(m_dev)
{
m_dev->Reset(1, 1, GSDevice::Windowed);
}
delete m_dev;
}

View File

@ -39,6 +39,11 @@ GSRendererSW::GSRendererSW(uint8* base, bool mt, void (*irq)(), GSDevice* dev)
GSRendererSW::~GSRendererSW()
{
delete m_tc;
for(int i = 0; i < countof(m_texture); i++)
{
delete m_texture[i];
}
}
void GSRendererSW::Reset()

View File

@ -27,6 +27,11 @@ GSTextureFX9::GSTextureFX9()
{
}
GSTextureFX9::~GSTextureFX9()
{
for_each(m_mskfix.begin(), m_mskfix.end(), delete_second());
}
bool GSTextureFX9::Create(GSDevice* dev)
{
if(!__super::Create(dev))

View File

@ -39,6 +39,7 @@ class GSTextureFX9 : public GSTextureFX
public:
GSTextureFX9();
virtual ~GSTextureFX9();
bool Create(GSDevice* dev);