Skip to content

Commit

Permalink
Merge pull request #336 from altmp/feature/js-timers-leak
Browse files Browse the repository at this point in the history
Fix js-module timers leak
  • Loading branch information
vadzz-dev committed Dec 16, 2024
1 parent 7e66bea commit 413567e
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 413567e

Please sign in to comment.