diff options
Diffstat (limited to 'src/util/com_util.hpp')
-rw-r--r-- | src/util/com_util.hpp | 22 |
1 files changed, 0 insertions, 22 deletions
diff --git a/src/util/com_util.hpp b/src/util/com_util.hpp deleted file mode 100644 index bbaf1c27..00000000 --- a/src/util/com_util.hpp +++ /dev/null @@ -1,22 +0,0 @@ -#pragma once -#include "pre.hpp" - -#include <memory> - -namespace cru::util { - -template <typename TInterface> -std::shared_ptr<TInterface> CreateComSharedPtr(TInterface* p) { - return std::shared_ptr<TInterface>(p, [](TInterface* ptr) { - if (ptr != nullptr) ptr->Release(); - }); -} - -template <class TInterface> -void SafeRelease(TInterface*& p) { - if (p != nullptr) { - p->Release(); - p = nullptr; - } -} -} // namespace cru::util |