| 1424 | |
| 1425 | |
| 1426 | void 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 |
no test coverage detected