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,7 +79,8 @@ CD3D9Driver::~CD3D9Driver() ...@@ -79,7 +79,8 @@ CD3D9Driver::~CD3D9Driver()
removeAllOcclusionQueries(); removeAllOcclusionQueries();
removeAllHardwareBuffers(); removeAllHardwareBuffers();
DepthStencilSurface->Release(); if (DepthStencilSurface)
DepthStencilSurface->Release();
delete BridgeCalls; delete BridgeCalls;
...@@ -2857,15 +2858,16 @@ bool CD3D9Driver::reset() ...@@ -2857,15 +2858,16 @@ bool CD3D9Driver::reset()
for (u32 i = 0; i < RenderTargetChannel.size(); ++i) for (u32 i = 0; i < RenderTargetChannel.size(); ++i)
RenderTargetChannel[i] = -1; RenderTargetChannel[i] = -1;
DepthStencilSurface->Release(); if (DepthStencilSurface)
DepthStencilSurface->Release();
DriverWasReset=true; DriverWasReset=true;
HRESULT hr = pID3DDevice->Reset(&present); HRESULT hr = pID3DDevice->Reset(&present);
// restore screen depthbuffer descriptor // restore screen depthbuffer descriptor
pID3DDevice->GetDepthStencilSurface(&DepthStencilSurface); if (SUCCEEDED(pID3DDevice->GetDepthStencilSurface(&DepthStencilSurface)))
DepthStencilSurface->Release(); DepthStencilSurface->Release();
// restore RTTs // restore RTTs
for (i=0; i<Textures.size(); ++i) for (i=0; i<Textures.size(); ++i)
......
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