[host] remove the invalid usage of SafeRelease

SafeRelease was really useless, derefencing the smart pointers through
the use of & releases the value before SafeRelease get's to it. Instead
either allow the destructor to handle it's release, or explicityly
release it by assigning NULL
This commit is contained in:
Geoffrey McRae
2018-07-28 10:25:57 +10:00
parent f692284f27
commit a989914fef
4 changed files with 42 additions and 69 deletions

View File

@@ -39,6 +39,7 @@ _COM_SMARTPTR_TYPEDEF(IMFActivate , __uuidof(IMFActivate
_COM_SMARTPTR_TYPEDEF(IMFAttributes , __uuidof(IMFAttributes ));
_COM_SMARTPTR_TYPEDEF(IMFDXGIDeviceManager , __uuidof(IMFDXGIDeviceManager ));
_COM_SMARTPTR_TYPEDEF(IMFTransform , __uuidof(IMFTransform ));
_COM_SMARTPTR_TYPEDEF(IMFMediaEvent , __uuidof(IMFMediaEvent ));
_COM_SMARTPTR_TYPEDEF(IMFMediaEventGenerator , __uuidof(IMFMediaEventGenerator ));
_COM_SMARTPTR_TYPEDEF(IMFMediaType , __uuidof(IMFMediaType ));
_COM_SMARTPTR_TYPEDEF(IMFSample , __uuidof(IMFSample ));
@@ -52,14 +53,4 @@ _COM_SMARTPTR_TYPEDEF(ID3D11InputLayout , __uuidof(ID3D11InputLayout
_COM_SMARTPTR_TYPEDEF(ID3D11VertexShader , __uuidof(ID3D11VertexShader ));
_COM_SMARTPTR_TYPEDEF(ID3D11PixelShader , __uuidof(ID3D11PixelShader ));
_COM_SMARTPTR_TYPEDEF(ID3D11SamplerState , __uuidof(ID3D11SamplerState ));
_COM_SMARTPTR_TYPEDEF(ID3D11Buffer , __uuidof(ID3D11Buffer ));
template <class T> void SafeRelease(T **ppT)
{
if (*ppT)
{
(*ppT)->Release();
*ppT = NULL;
}
}
_COM_SMARTPTR_TYPEDEF(ID3D11Buffer , __uuidof(ID3D11Buffer ));