mirror of
https://github.com/konvajs/konva.git
synced 2025-12-17 09:54:56 +08:00
fix memory leak. close #198
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user