Skip to content

Commit

Permalink
element.off #55
Browse files Browse the repository at this point in the history
  • Loading branch information
popomore committed Jul 1, 2013
1 parent 0a2ee9e commit 42304a8
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/widget.js
Original file line number Diff line number Diff line change
Expand Up @@ -320,12 +320,12 @@ define(function(require, exports, module) {
delete cachedInstances[this.cid]

// For memory leak
if (this.element) {
if (this.element && this._isTemplate) {
this.element.off()
// 如果是 widget 生成的 element 则去除
this._isTemplate && (this._outerBox || this.element).remove()
this.element = null
(this._outerBox || this.element).remove()
}
this.element = null

Widget.superclass.destroy.call(this)
}
Expand Down

0 comments on commit 42304a8

Please sign in to comment.