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

Method ClearCommands

src/Bindings/PluginLua.cpp:1426–1439  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1424
1425
1426void cPluginLua::ClearCommands(void)
1427{
1428 cCSLock Lock(m_CriticalSection);
1429
1430 // Unreference the bound functions so that Lua can GC them
1431 if (m_LuaState != NULL)
1432 {
1433 for (CommandMap::iterator itr = m_Commands.begin(), end = m_Commands.end(); itr != end; ++itr)
1434 {
1435 luaL_unref(m_LuaState, LUA_REGISTRYINDEX, itr->second);
1436 }
1437 }
1438 m_Commands.clear();
1439}
1440
1441
1442

Callers 1

RemovePluginCommandsMethod · 0.80

Calls 4

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

Tested by

no test coverage detected