diff --git a/js/eventloop.go b/js/eventloop.go index bb3da6f..a9b69e5 100644 --- a/js/eventloop.go +++ b/js/eventloop.go @@ -148,7 +148,12 @@ func (e *EventLoop) Stop() { // clean the queue e.queue = e.queue[:0] e.enqueue = 0 - e.doneJobs = e.doneJobs[:0] + if len(e.doneJobs) > 0 { + for _, job := range e.doneJobs { + job() + } + e.doneJobs = e.doneJobs[:0] + } e.cond.Signal() }