Commit fe1cc12
committed
fix(event-loop): timers with a complicated job function can't be automatically unref'ed sometimes
See issue: heap-use-after-free in timerJobWrapper (#341)
We need to ensure the memory block doesn't move for reallocation before we can use the pointer to the timer's `AsyncHandle`, as we could have multiple new `setTimeout` calls to expand the `_timeoutIdMap` vector while running the job function in parallel.1 parent 4e20616 commit fe1cc12
1 file changed
+1
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
38 | 38 | | |
39 | 39 | | |
40 | 40 | | |
41 | | - | |
42 | 41 | | |
43 | 42 | | |
44 | 43 | | |
45 | 44 | | |
46 | 45 | | |
47 | 46 | | |
| 47 | + | |
48 | 48 | | |
49 | 49 | | |
50 | 50 | | |
| |||
0 commit comments