fix potential leak in scrollbox.xml

This commit is contained in:
Dão Gottwald 2009-07-10 10:29:20 +02:00
parent 95a6a24425
commit d536e0aa34

View File

@ -44,6 +44,7 @@
<implementation>
<destructor><![CDATA[
this._stopSmoothScroll();
this._scrollTarget = null;
]]></destructor>
<field name="_scrollbox">
@ -241,8 +242,10 @@
}
self.scrollByPixels(distance);
if (!scrollAmounts.length)
if (!scrollAmounts.length) {
self._stopSmoothScroll();
self._scrollTarget = null;
}
}
// amountToScroll: total distance to scroll
@ -389,8 +392,11 @@
<method name="_stopSmoothScroll">
<body><![CDATA[
if (this._isScrolling) {
if (this._smoothScrollTimer) {
clearInterval(this._smoothScrollTimer);
this._smoothScrollTimer = 0;
}
if (this._isScrolling) {
this._isScrolling = 0;
this._scrollTarget = null;
}