Skip to content

Commit

Permalink
Fix js-module timers leak
Browse files Browse the repository at this point in the history
  • Loading branch information
vadzz-dev committed Dec 16, 2024
1 parent 5fd9c7a commit e8744d8
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion shared/V8ResourceImpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,16 @@ void V8ResourceImpl::OnTick()
for(auto& nextTickCb : nextTickCallbacks) nextTickCb();
nextTickCallbacks.clear();

for(auto& id : oldTimers) timers.erase(id);
for(auto& id : oldTimers)
{
auto it = timers.find(id);
if(it == timers.end())
continue;

auto timer = it->second;
timers.erase(it);
delete timer;
}

oldTimers.clear();

Expand Down

0 comments on commit e8744d8

Please sign in to comment.