MCPcopy Create free account
hub / github.com/cuberite/cuberite / ClearConsoleCommands

Method ClearConsoleCommands

src/Bindings/PluginLua.cpp:1445–1458  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1443
1444
1445void cPluginLua::ClearConsoleCommands(void)
1446{
1447 cCSLock Lock(m_CriticalSection);
1448
1449 // Unreference the bound functions so that Lua can GC them
1450 if (m_LuaState != NULL)
1451 {
1452 for (CommandMap::iterator itr = m_ConsoleCommands.begin(), end = m_ConsoleCommands.end(); itr != end; ++itr)
1453 {
1454 luaL_unref(m_LuaState, LUA_REGISTRYINDEX, itr->second);
1455 }
1456 }
1457 m_ConsoleCommands.clear();
1458}
1459
1460
1461

Callers 1

Calls 4

luaL_unrefFunction · 0.85
beginMethod · 0.80
endMethod · 0.80
clearMethod · 0.80

Tested by

no test coverage detected