Migrate calls to releasing COM objects in Renderer11 to new SafeRelease helper method.

TRAC #22898 Signed-off-by: Geoff Lang Signed-off-by: Shannon Woods Author: Jamie Madill git-svn-id: https://angleproject.googlecode.com/svn/branches/dx11proto@2218 736b8ea6-26fd-11df-bfd4-992fa37f6226
parent 56105ff9
...@@ -1760,111 +1760,30 @@ void Renderer11::releaseDeviceResources() ...@@ -1760,111 +1760,30 @@ void Renderer11::releaseDeviceResources()
delete mTriangleFanIB; delete mTriangleFanIB;
mTriangleFanIB = NULL; mTriangleFanIB = NULL;
if (mCopyVB) SafeRelease(mCopyVB);
{ SafeRelease(mCopySampler);
mCopyVB->Release(); SafeRelease(mCopyIL);
mCopyVB = NULL; SafeRelease(mCopyIL);
} SafeRelease(mCopyVS);
SafeRelease(mCopyRGBAPS);
if (mCopySampler) SafeRelease(mCopyRGBPS);
{ SafeRelease(mCopyLumPS);
mCopySampler->Release(); SafeRelease(mCopyLumAlphaPS);
mCopySampler = NULL;
}
if (mCopyIL)
{
mCopyIL->Release();
mCopyIL = NULL;
}
if (mCopyVS)
{
mCopyVS->Release();
mCopyVS = NULL;
}
if (mCopyRGBAPS)
{
mCopyRGBAPS->Release();
mCopyRGBAPS = NULL;
}
if (mCopyRGBPS)
{
mCopyRGBPS->Release();
mCopyRGBPS = NULL;
}
if (mCopyLumPS)
{
mCopyLumPS->Release();
mCopyLumPS = NULL;
}
if (mCopyLumAlphaPS)
{
mCopyLumAlphaPS->Release();
mCopyLumAlphaPS = NULL;
}
mCopyResourcesInitialized = false; mCopyResourcesInitialized = false;
if (mClearVB) SafeRelease(mClearVB);
{ SafeRelease(mClearIL);
mClearVB->Release(); SafeRelease(mClearVS);
mClearVB = NULL; SafeRelease(mClearPS);
} SafeRelease(mClearScissorRS);
SafeRelease(mClearNoScissorRS);
if (mClearIL)
{
mClearIL->Release();
mClearIL = NULL;
}
if (mClearVS)
{
mClearVS->Release();
mClearVS = NULL;
}
if (mClearPS)
{
mClearPS->Release();
mClearPS = NULL;
}
if (mClearScissorRS)
{
mClearScissorRS->Release();
mClearScissorRS = NULL;
}
if (mClearNoScissorRS)
{
mClearNoScissorRS->Release();
mClearNoScissorRS = NULL;
}
mClearResourcesInitialized = false; mClearResourcesInitialized = false;
if (mDriverConstantBufferVS) SafeRelease(mDriverConstantBufferVS);
{ SafeRelease(mDriverConstantBufferPS);
mDriverConstantBufferVS->Release(); SafeRelease(mSyncQuery);
mDriverConstantBufferVS = NULL;
}
if (mDriverConstantBufferPS)
{
mDriverConstantBufferPS->Release();
mDriverConstantBufferPS = NULL;
}
if (mSyncQuery)
{
mSyncQuery->Release();
mSyncQuery = NULL;
}
} }
void Renderer11::notifyDeviceLost() void Renderer11::notifyDeviceLost()
......
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