Commit b964433
committed
env: fix use-after-free in keep-alive allocators
As per comment in the change it is possible that
`Environment:AddArrayBufferAllocatorToKeepAliveUntilIsolateDispose`
is called after:
1. `Node::Stop(env)`
2. `Environment::~Environment()`
In this case platform's `per_isolate_` map won't have an entry for our
isolate and the `AddIsolateFinishedCallback` will invoke the callback
immediately leaving us with `keep_alive_allocators_` set to freed pointer.
This commit also changes the assertion in the
`AddIsolateFinishedCallback` that is triggered incorrectly.1 parent 7d488fe commit b964433
2 files changed
+13
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1153 | 1153 | | |
1154 | 1154 | | |
1155 | 1155 | | |
| 1156 | + | |
| 1157 | + | |
| 1158 | + | |
| 1159 | + | |
| 1160 | + | |
| 1161 | + | |
| 1162 | + | |
| 1163 | + | |
| 1164 | + | |
| 1165 | + | |
| 1166 | + | |
| 1167 | + | |
1156 | 1168 | | |
1157 | 1169 | | |
1158 | 1170 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
359 | 359 | | |
360 | 360 | | |
361 | 361 | | |
362 | | - | |
363 | 362 | | |
364 | 363 | | |
365 | 364 | | |
| 365 | + | |
366 | 366 | | |
367 | 367 | | |
368 | 368 | | |
| |||
0 commit comments