diff --git a/plugins/GSdx/GPURendererSW.cpp b/plugins/GSdx/GPURendererSW.cpp index 0b5acbff97..71b8a17ef7 100644 --- a/plugins/GSdx/GPURendererSW.cpp +++ b/plugins/GSdx/GPURendererSW.cpp @@ -32,6 +32,7 @@ GPURendererSW::GPURendererSW(GSDevice* dev) GPURendererSW::~GPURendererSW() { + delete m_texture; } void GPURendererSW::ResetDevice() diff --git a/plugins/GSdx/GSAlignedClass.h b/plugins/GSdx/GSAlignedClass.h index 4f9136ebd1..ec33030892 100644 --- a/plugins/GSdx/GSAlignedClass.h +++ b/plugins/GSdx/GSAlignedClass.h @@ -25,6 +25,7 @@ template class GSAlignedClass { public: GSAlignedClass() {} + virtual ~GSAlignedClass() {} void* operator new (size_t size) { diff --git a/plugins/GSdx/GSDevice9.cpp b/plugins/GSdx/GSDevice9.cpp index 99788516bd..03e6237a21 100644 --- a/plugins/GSdx/GSDevice9.cpp +++ b/plugins/GSdx/GSDevice9.cpp @@ -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; diff --git a/plugins/GSdx/GSDevice9.h b/plugins/GSdx/GSDevice9.h index 4a34533ae3..e31f6df508 100644 --- a/plugins/GSdx/GSDevice9.h +++ b/plugins/GSdx/GSDevice9.h @@ -92,6 +92,7 @@ private: DDCAPS m_ddcaps; D3DCAPS9 m_d3dcaps; + D3DPRESENT_PARAMETERS m_pp; CComPtr m_d3d; CComPtr m_dev; CComPtr m_swapchain; @@ -104,7 +105,6 @@ private: } m_vertices; public: // TODO - D3DPRESENT_PARAMETERS m_pp; struct { diff --git a/plugins/GSdx/GSRenderer.cpp b/plugins/GSdx/GSRenderer.cpp index f442333eb7..38ee242b1e 100644 --- a/plugins/GSdx/GSRenderer.cpp +++ b/plugins/GSdx/GSRenderer.cpp @@ -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; } diff --git a/plugins/GSdx/GSRendererSW.cpp b/plugins/GSdx/GSRendererSW.cpp index f525192b49..2a5213250e 100644 --- a/plugins/GSdx/GSRendererSW.cpp +++ b/plugins/GSdx/GSRendererSW.cpp @@ -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() diff --git a/plugins/GSdx/GSTextureFX9.cpp b/plugins/GSdx/GSTextureFX9.cpp index 891085c949..79cb4bdae7 100644 --- a/plugins/GSdx/GSTextureFX9.cpp +++ b/plugins/GSdx/GSTextureFX9.cpp @@ -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)) diff --git a/plugins/GSdx/GSTextureFX9.h b/plugins/GSdx/GSTextureFX9.h index 317037f695..d20b5b1229 100644 --- a/plugins/GSdx/GSTextureFX9.h +++ b/plugins/GSdx/GSTextureFX9.h @@ -39,6 +39,7 @@ class GSTextureFX9 : public GSTextureFX public: GSTextureFX9(); + virtual ~GSTextureFX9(); bool Create(GSDevice* dev);