| 1443 | |
| 1444 | |
| 1445 | void 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 |
no test coverage detected