summaryrefslogtreecommitdiff
path: root/Source/Asura.Engine/scripting/portable.inl
blob: a27b2e871879af283549e3fca1238d7a781b779a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30

template<typename T>
Portable<T>::Portable()
	: mRefCount(1)
	, mSafer(false)
{
}

template<typename T> 
Portable<T>::~Portable()
{
	ASSERT(mSafer);
}

template<typename T>
void Portable<T>::Retain()
{
	++mRefCount;
}

template<typename T>
void Portable<T>::Release()
{
	if (--mRefCount <= 0)
	{
		mSafer = true;
		delete this;
	}
}