blob: cbe2934b94609a75e004dd475fa2fce884c471b8 (
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
31
32
33
34
35
36
|
#pragma once
#include "Configuration/UnityConfigure.h"
#include "Runtime/Mono/MonoIncludes.h"
#include "Runtime/Scripting/ScriptingUtility.h"
#include "Runtime/Scripting/Backend/ScriptingBackendApi.h"
class TrackedReferenceBase
{
public:
int m_MonoObjectReference;
TrackedReferenceBase ()
{
m_MonoObjectReference = 0;
}
~TrackedReferenceBase ()
{
#if ENABLE_SCRIPTING
if (m_MonoObjectReference)
{
ScriptingObjectPtr target = scripting_gchandle_get_target (m_MonoObjectReference);
if (target)
{
void* nativePointer = 0;
MarshallNativeStructIntoManaged(nativePointer,target);
target = SCRIPTING_NULL;
}
scripting_gchandle_free (m_MonoObjectReference);
m_MonoObjectReference = 0;
}
#endif
}
};
|