prevent memory leak
Project: http://git-wip-us.apache.org/repos/asf/flex-sdk/repo Commit: http://git-wip-us.apache.org/repos/asf/flex-sdk/commit/42cdd44b Tree: http://git-wip-us.apache.org/repos/asf/flex-sdk/tree/42cdd44b Diff: http://git-wip-us.apache.org/repos/asf/flex-sdk/diff/42cdd44b Branch: refs/heads/master Commit: 42cdd44b80cfb6b28bb72176183f116c9f537dc8 Parents: e7b498e Author: Alex Harui <[email protected]> Authored: Tue Jan 13 17:49:01 2015 -0800 Committer: Alex Harui <[email protected]> Committed: Tue Jan 13 17:49:01 2015 -0800 ---------------------------------------------------------------------- .../src/spark/skins/mobile/BusyIndicatorSkin.as | 12 ++++++++++++ 1 file changed, 12 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/42cdd44b/frameworks/projects/mobiletheme/src/spark/skins/mobile/BusyIndicatorSkin.as ---------------------------------------------------------------------- diff --git a/frameworks/projects/mobiletheme/src/spark/skins/mobile/BusyIndicatorSkin.as b/frameworks/projects/mobiletheme/src/spark/skins/mobile/BusyIndicatorSkin.as index d56f6bd..040bf53 100644 --- a/frameworks/projects/mobiletheme/src/spark/skins/mobile/BusyIndicatorSkin.as +++ b/frameworks/projects/mobiletheme/src/spark/skins/mobile/BusyIndicatorSkin.as @@ -23,6 +23,7 @@ package spark.skins.mobile import flash.display.CapsStyle; import flash.display.Graphics; import flash.display.LineScaleMode; + import flash.events.Event; import flash.events.TimerEvent; import flash.geom.Point; import flash.utils.Timer; @@ -60,6 +61,8 @@ package spark.skins.mobile { super(); alpha = 0.60; // default alpha + // component changes state when removed but it doesn't get validated in time + addEventListener(Event.REMOVED_FROM_STAGE, removedFromStageHandler,false,0,true); } private var _hostComponent:spark.components.BusyIndicator; @@ -453,5 +456,14 @@ package spark.skins.mobile event.updateAfterEvent(); } + /** + * @private + */ + private function removedFromStageHandler(event:Event):void + { + stopRotation(); + } + + } } \ No newline at end of file
