worker cleanup

This commit is contained in:
Fabian Jakobs 2011-01-23 15:02:38 +01:00
commit cc343350c0
2 changed files with 5 additions and 0 deletions

View file

@ -152,6 +152,10 @@ oop.inherits(Mode, TextMode);
session.setAnnotations(errors)
});
worker.on("terminate", function() {
session.clearAnnotations();
});
return worker;
};

View file

@ -65,6 +65,7 @@ var WorkerClient = function(baseUrl, topLevelNamespaces, module, classname) {
oop.implement(this, EventEmitter);
this.terminate = function() {
this._dispatchEvent("terminate", {});
this.$worker.terminate();
};