Make sure the frame handler stops when a view is removed.

This commit is contained in:
Jürg Lehni 2011-05-16 00:05:11 +01:00
parent abcba7deb4
commit 3e71278b78

View file

@ -143,7 +143,8 @@ var DocumentView = this.DocumentView = Base.extend({
var res = Base.splice(this._document.views, null, this._index, 1);
// Uninstall event handlers again for this view.
DomEvent.remove(this._canvas, this._events);
this._document = this._canvas = this._events = null;
// Clearing _onFrame makes the frame handler stop automatically.
this._document = this._canvas = this._events = that._onFrame = null;
return !!res.length;
},