free core instance on stop core service

This commit is contained in:
nklhrstv 2020-05-18 12:20:16 +03:00
parent cbd0f7a337
commit 1edf6484d8
2 changed files with 8 additions and 1 deletions

View file

@ -93,7 +93,11 @@ function Core() {
active = false;
error = null;
starting = false;
transport = null;
if (transport !== null) {
transport.free();
transport = null;
}
onStateChanged();
};
this.on = function(name, listener) {

View file

@ -28,6 +28,9 @@ function CoreTransport() {
this.getState = function(model) {
return core.get_state(model);
};
this.free = function() {
core.free();
};
}
module.exports = CoreTransport;