Commit 9c337089 authored by nadro's avatar nadro

- Fixed issue with null pointer.

git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@5077 dfc29bdd-3216-0410-991c-e03cc46cb475
parent d2169fc4
......@@ -79,6 +79,7 @@ CD3D9Driver::~CD3D9Driver()
removeAllOcclusionQueries();
removeAllHardwareBuffers();
if (DepthStencilSurface)
DepthStencilSurface->Release();
delete BridgeCalls;
......@@ -2857,6 +2858,7 @@ bool CD3D9Driver::reset()
for (u32 i = 0; i < RenderTargetChannel.size(); ++i)
RenderTargetChannel[i] = -1;
if (DepthStencilSurface)
DepthStencilSurface->Release();
DriverWasReset=true;
......@@ -2864,7 +2866,7 @@ bool CD3D9Driver::reset()
HRESULT hr = pID3DDevice->Reset(&present);
// restore screen depthbuffer descriptor
pID3DDevice->GetDepthStencilSurface(&DepthStencilSurface);
if (SUCCEEDED(pID3DDevice->GetDepthStencilSurface(&DepthStencilSurface)))
DepthStencilSurface->Release();
// restore RTTs
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment