null worker before next load

pull/7/head
Liana Husikyan 5 years ago committed by Aniket
parent 8a00e27fcb
commit 55da511533
  1. 7
      remix-solidity/src/compiler/compiler.js

@ -240,6 +240,10 @@ function Compiler (handleImportCall) {
console.log('Loading ' + url + ' ' + (usingWorker ? 'with worker' : 'without worker'))
self.event.trigger('loadingCompiler', [url, usingWorker])
if (worker !== null) {
worker.terminate()
worker = null
}
if (usingWorker) {
loadWorker(url)
} else {
@ -271,9 +275,6 @@ function Compiler (handleImportCall) {
}
function loadWorker (url) {
if (worker !== null) {
worker.terminate()
}
worker = webworkify(require('./compiler-worker.js'))
var jobs = []
worker.addEventListener('message', function (msg) {

Loading…
Cancel
Save