mirror of
https://github.com/zebrajr/node.git
synced 2025-12-06 00:20:08 +01:00
src: move CHECK in AddIsolateFinishedCallback
`CHECK(it->second)` asserts that we have `PerIsolatePlatformData` in the `per_isolate_` map, and not just a key with empty value. When `it == per_isolate_.end()`, however, it means that we don't have the isolate and the `CHECK(it->second)` is guaranteed to fail then! PR-URL: https://github.com/nodejs/node/pull/38010 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
This commit is contained in:
parent
30ce0e66ae
commit
f552c45676
|
|
@ -359,10 +359,10 @@ void NodePlatform::AddIsolateFinishedCallback(Isolate* isolate,
|
|||
Mutex::ScopedLock lock(per_isolate_mutex_);
|
||||
auto it = per_isolate_.find(isolate);
|
||||
if (it == per_isolate_.end()) {
|
||||
CHECK(it->second);
|
||||
cb(data);
|
||||
return;
|
||||
}
|
||||
CHECK(it->second);
|
||||
it->second->AddShutdownCallback(cb, data);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user