Bug 1678774 - Cancel off-thread compilations when destroying a ScriptLoader r=dpalmeiro
There are parse tasks present when the JS engine is being shut down that have finished but haven't had their results collected by the embedding. This shouldn't happen, and I think it's happening here because we're leaking a JSRuntime (we cancel these when we shut down a runtime). There's a comment that says this isn't necessary but cancelling outstanding compile requests in ScriptLoader::Destroy fixes this problem on try. I don't understand well enough to know what's going wrong with the current approach but this fixes both the crash and the leak. Differential Revision: https://phabricator.services.mozilla.com/D119315
This commit is contained in:
@@ -150,8 +150,8 @@ void ScriptLoadRequest::SetReady() {
|
||||
}
|
||||
|
||||
void ScriptLoadRequest::Cancel() {
|
||||
MaybeCancelOffThreadScript();
|
||||
mIsCanceled = true;
|
||||
MaybeCancelOffThreadScript();
|
||||
}
|
||||
|
||||
void ScriptLoadRequest::MaybeCancelOffThreadScript() {
|
||||
|
||||
Reference in New Issue
Block a user