implemented destroy & updated disconnect

This commit is contained in:
Kevin Jahns
2016-02-16 15:51:12 +01:00
parent bd54a43a33
commit da7e67d97d
3 changed files with 27 additions and 5 deletions

View File

@@ -176,9 +176,17 @@ module.exports = function (Y /* :any */) {
this.gc2 = this.gc2.filter(filter)
delete op.gc
}
destroy () {
* destroy () {
clearInterval(this.gcInterval)
this.gcInterval = null
for(var key in this.initializedTypes) {
var type = this.initializedTypes[key]
if (type._destroy != null) {
type._destroy()
} else {
console.error('The type you included does not provide destroy functionality, it will remain in memory (updating your packages will help).')
}
}
}
setUserId (userId) {
if (!this.userIdPromise.inProgress) {