MCPcopy Create free account
hub / github.com/Tencent/UnLua / Push

Method Push

Plugins/UnLua/Source/UnLua/Private/Registries/ObjectRegistry.cpp:83–104  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

81 }
82
83 void FObjectRegistry::Push(lua_State* L, UObject* Object)
84 {
85 if (!Object)
86 {
87 lua_pushnil(L);
88 return;
89 }
90
91 lua_getfield(L, LUA_REGISTRYINDEX, REGISTRY_KEY);
92 lua_pushlightuserdata(L, Object);
93 const auto Type = lua_rawget(L, -2);
94 if (Type == LUA_TNIL)
95 {
96 lua_pop(L, 1);
97 PushObjectCore(L, Object);
98 lua_pushlightuserdata(L, Object);
99 lua_pushvalue(L, -2);
100 lua_rawset(L, -4);
101 ObjectRefs.Add(Object, LUA_NOREF);
102 }
103 lua_remove(L, -2);
104 }
105
106 int FObjectRegistry::Bind(UObject* Object)
107 {

Callers

nothing calls this directly

Calls 8

lua_pushnilFunction · 0.85
lua_getfieldFunction · 0.85
lua_pushlightuserdataFunction · 0.85
lua_rawgetFunction · 0.85
PushObjectCoreFunction · 0.85
lua_pushvalueFunction · 0.85
lua_rawsetFunction · 0.85
AddMethod · 0.45

Tested by

no test coverage detected