Elaztek Developer Hub
Switch Project...
blam!
Editing Kit
Guerilla
Sapien
Tool
Foundry
Libraries
Keystone
Strings
Forums
Discord
Doxygen
Jenkins
Guides
Gitlab
Blamite Game Engine - Strings
00390.07.02.23.1947.blamite
A library containing general purpose utilities and classes for use in multiple projects.
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
Strings
components
utils
saferelease
saferelease.h
Generated on Sun Jul 2 2023 23:08:42 for Blamite Game Engine - Strings by
1.8.17