Plasma Engine  2.0
Loading...
Searching...
No Matches
ScopedCFRef.h
1#pragma once
2
3#include <Foundation/FoundationInternal.h>
4PL_FOUNDATION_INTERNAL_HEADER
5
6#include <CoreFoundation/CoreFoundation.h>
7
9template <typename T>
11{
12public:
13 plScopedCFRef(T Ref)
14 : m_Ref(Ref)
15 {
16 }
17
19 {
20 CFRelease(m_Ref);
21 }
22
23 operator T() const
24 {
25 return m_Ref;
26 }
27
28private:
29 T m_Ref;
30};
Helper class to release references of core foundation objects correctly.
Definition ScopedCFRef.h:11