void OnAmxxDetach() { while (!g_FreeTRs.empty()) { delete g_FreeTRs.front(); g_FreeTRs.pop(); } while (!g_KVDWs.empty()) delete g_KVDWs.popCopy(); while (!g_FreeKVDWs.empty()) delete g_FreeKVDWs.popCopy(); }
void OnAmxxDetach() { ConfigManager->CloseGameConfigFile(CommonConfig); ConfigManager->CloseGameConfigFile(GamerulesConfig); while (!g_FreeTRs.empty()) { delete g_FreeTRs.front(); g_FreeTRs.pop(); } while (!g_KVDWs.empty()) delete g_KVDWs.popCopy(); while (!g_FreeKVDWs.empty()) delete g_FreeKVDWs.popCopy(); }
static void EnterMemoryScope(ke::Vector<MemoryScope>& frame) { if (frame.empty()) frame.append(MemoryScope{0}); else frame.append(MemoryScope{frame.back().scope_id + 1}); }
void CLangMngr::CLang::MergeDefinitions(ke::Vector<sKeyDef> &vec) { ke::AutoString *pDef; int key = -1; while (!vec.empty()) { auto keydef = vec.popCopy(); key = keydef.key; pDef = keydef.definition; AddEntry(key, pDef->ptr()); delete pDef; } }
static cell AMX_NATIVE_CALL create_kvd(AMX *amx, cell *params) { KVD_Wrapper *kvdw; if (g_FreeKVDWs.empty()) { kvdw = new KVD_Wrapper; } else { kvdw = g_FreeKVDWs.popCopy(); } kvdw->cls = ""; kvdw->kvd.szClassName = const_cast<char*>(kvdw->cls.chars()); kvdw->key = ""; kvdw->kvd.szKeyName = const_cast<char*>(kvdw->key.chars()); kvdw->val = ""; kvdw->kvd.szValue = const_cast<char*>(kvdw->val.chars()); kvdw->kvd.fHandled = 0; g_KVDWs.append(kvdw); return reinterpret_cast<cell>(kvdw); }