修复tc_timer内存泄露

This commit is contained in:
wuxiaofeng1 2022-03-18 18:27:54 +08:00 committed by ruanshudong
parent 00c4b19c2e
commit ebeadaf813
2 changed files with 0 additions and 9 deletions

View File

@ -195,11 +195,6 @@ protected:
shared_ptr<Func> p = wPtr.lock();
if(p)
{
{
std::unique_lock <std::mutex> lock(_mutex);
_tmpEvent.erase(p->_uniqueId);
}
if (this->exist(p->_uniqueId, true))
{
if (p->_cron.isset)
@ -266,8 +261,6 @@ protected:
MAP_TIMER _mapTimer; //时间, 事件
MAP_EVENT _tmpEvent; //id, 事件
atomic_uint _increaseId = {0};
set<int64_t> _repeatIds; //循环任务的所有ID

View File

@ -140,8 +140,6 @@ int64_t TC_TimerBase::fireEvents(int64_t ms)
func = it->second;
_tmpEvent[it->first] = it->second;
_mapEvent.erase(it);
}
}