fix memory leak. close #198

This commit is contained in:
Anton Lavrenov
2017-01-10 08:27:32 -05:00
parent 523e7ebe90
commit e523c86ebd
5 changed files with 44 additions and 5 deletions

View File

@@ -606,7 +606,13 @@
destroy: function() {
// remove from ids and names hashes
Konva._removeId(this.getId());
Konva._removeName(this.getName(), this._id);
// remove all names
var names = (this.getName() || '').split(/\s/g);
for(var i = 0; i < names.length; i++) {
var subname = names[i];
Konva._removeName(subname, this._id);
}
this.remove();
return this;