示例#1
0
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();
}
示例#2
0
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();
}
示例#3
0
static void
EnterMemoryScope(ke::Vector<MemoryScope>& frame)
{
  if (frame.empty())
    frame.append(MemoryScope{0});
  else
    frame.append(MemoryScope{frame.back().scope_id + 1});
}
示例#4
0
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;
	}
}
示例#5
0
文件: fm_tr2.cpp 项目: Javivi/amxmodx
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);
}