Flesh out ::destroy()

This commit is contained in:
Daniel Hengeveld
2015-11-02 12:59:50 +01:00
parent 9081a891e6
commit 0c965f9439

View File

@@ -54,7 +54,15 @@ module.exports = class GitRepositoryAsync {
}
destroy () {
this.subscriptions.dispose()
if (this.emitter) {
this.emitter.emit('did-destroy')
this.emitter.dispose()
this.emitter = null
}
if (this.subscriptions) {
this.subscriptions.dispose()
this.subscriptions = null
}
}
getPath () {