[D3D12] Cleanup object destruction in Shutdown functions

This commit is contained in:
Triang3l
2018-08-26 00:24:25 +03:00
parent ff014d47d4
commit 791c275fab
5 changed files with 21 additions and 79 deletions

View File

@@ -17,7 +17,8 @@ namespace ui {
namespace d3d12 {
namespace util {
inline bool ReleaseAndNull(IUnknown*& object) {
template <typename T>
inline bool ReleaseAndNull(T& object) {
if (object != nullptr) {
object->Release();
object = nullptr;