Blamite Game Engine - blam!
00263.10.17.20.0001.blamite
The core library for the Blamite Game Engine.
blam
components
core
utils
saferelease
saferelease.h
Go to the documentation of this file.
1
#pragma once
2
9
template
<
class
Type>
void
SafeRelease
(Type** pointer)
10
{
11
if
(*pointer)
12
{
13
(*pointer)->Release();
14
*pointer = NULL;
15
}
16
}
17
24
template
<
typename
Type> Type*
SafeAcquire
(Type* newObject)
25
{
26
if
(newObject != NULL)
27
{
28
newObject->AddRef();
29
}
30
31
return
newObject;
32
}
33
41
template
<
typename
Type>
void
SafeSet
(Type** currentObject, Type* newObject)
42
{
43
SafeAcquire
(newObject);
44
SafeRelease
(¤tObject);
45
currentObject = newObject;
46
}
47
SafeRelease
void SafeRelease(Type **pointer)
Releases a pointer.
Definition:
saferelease.h:9
SafeSet
void SafeSet(Type **currentObject, Type *newObject)
Sets a new COM object, releasing the old one.
Definition:
saferelease.h:41
SafeAcquire
Type * SafeAcquire(Type *newObject)
Acquires an additional reference, if non-null.
Definition:
saferelease.h:24
Generated on Sat Oct 17 2020 12:42:10 for Blamite Game Engine - blam! by
1.8.17