Commit 55da5115 authored by Liana Husikyan's avatar Liana Husikyan Committed by Aniket

null worker before next load

parent 8a00e27f
...@@ -240,6 +240,10 @@ function Compiler (handleImportCall) { ...@@ -240,6 +240,10 @@ function Compiler (handleImportCall) {
console.log('Loading ' + url + ' ' + (usingWorker ? 'with worker' : 'without worker')) console.log('Loading ' + url + ' ' + (usingWorker ? 'with worker' : 'without worker'))
self.event.trigger('loadingCompiler', [url, usingWorker]) self.event.trigger('loadingCompiler', [url, usingWorker])
if (worker !== null) {
worker.terminate()
worker = null
}
if (usingWorker) { if (usingWorker) {
loadWorker(url) loadWorker(url)
} else { } else {
...@@ -271,9 +275,6 @@ function Compiler (handleImportCall) { ...@@ -271,9 +275,6 @@ function Compiler (handleImportCall) {
} }
function loadWorker (url) { function loadWorker (url) {
if (worker !== null) {
worker.terminate()
}
worker = webworkify(require('./compiler-worker.js')) worker = webworkify(require('./compiler-worker.js'))
var jobs = [] var jobs = []
worker.addEventListener('message', function (msg) { worker.addEventListener('message', function (msg) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment