Bug 1540913 - Part 2: Clear and shutdown ModuleLoader at worker termination; r=asuth,jonco
When running an infinitely-looping dynamic import, it is possible for the module loader to still be holding on to that module at shutdown. Shutdown on the worker means that we will no longer run the event loop, which will execute the dynamic import promises necessary to clear the global. The result is that the global is kept alive. By calling `Shutdown()` we prevent this partially. We additionally need to address the failure in the module code (next patch). Differential Revision: https://phabricator.services.mozilla.com/D171683
This commit is contained in:
@@ -993,6 +993,7 @@ ModuleLoaderBase::~ModuleLoaderBase() {
|
||||
}
|
||||
|
||||
void ModuleLoaderBase::Shutdown() {
|
||||
CancelAndClearDynamicImports();
|
||||
MOZ_ASSERT(mFetchingModules.IsEmpty());
|
||||
|
||||
for (const auto& entry : mFetchedModules) {
|
||||
|
||||
Reference in New Issue
Block a user