MCPcopy Create free account
hub / github.com/OGSR/OGSR-Engine / release

Method release

ogsr_engine/xrGame/script_vars_storage.cpp:26–45  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

24}
25
26void SCRIPT_VAR::release()
27{
28 SCRIPT_VAR sv = *this;
29 ZeroMemory(this, sizeof(SCRIPT_VAR));
30
31 if (LUA_TTABLE == sv.eff_type())
32 {
33 sv.T->release(); // могут остаться ссылки в скриптах
34 return;
35 }
36
37 if (LUA_TNETPACKET == sv.eff_type())
38 {
39 xr_delete(sv.P);
40 return;
41 }
42
43 if (sv.type & SVT_ALLOCATED)
44 xr_free(sv.data);
45}
46
47void* SCRIPT_VAR::smart_alloc(int new_type, u32 cb) // схема автоматического выделения памяти
48{

Callers 3

clearMethod · 0.45
setMethod · 0.45
script_vars_releaseFunction · 0.45

Calls 4

ZeroMemoryFunction · 0.85
xr_deleteFunction · 0.85
xr_freeFunction · 0.85
eff_typeMethod · 0.80

Tested by

no test coverage detected