Free objects at end of scope

This commit is contained in:
Younes Aassila 2024-03-06 20:42:15 +01:00
parent b57c5e96eb
commit e7a8528f0a

View File

@ -93,8 +93,6 @@ window.Worker = class Worker extends window.Worker {
new Blob([wrapperScript], { type: "text/javascript" })
);
super(wrapperScriptURL, options);
URL.revokeObjectURL(newScriptURL);
URL.revokeObjectURL(wrapperScriptURL);
pageState.twitchWorker = this;
this.addEventListener("message", event => {
if (
@ -104,6 +102,8 @@ window.Worker = class Worker extends window.Worker {
window.postMessage(event.data);
}
});
URL.revokeObjectURL(newScriptURL);
URL.revokeObjectURL(wrapperScriptURL);
}
};