Uploaded image for project: 'Apache Flex'
  1. Apache Flex
  2. FLEX-16081

memory leak when update label's text in Timer

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • Adobe Flex SDK Previous
    • None
    • mx: Label
    • None
    • Affected OS(s): All OS Platforms
      Affected OS(s): All OS Platforms
      Language Found: English

    Description

      Steps to reproduce:
      1. Test.mxml as follows:
      <?xml version="1.0" encoding="utf-8"?>
      <mx:WindowedApplication xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" creationComplete="init()">
      <mx:Label x="85" y="91" text="Label" id="time_label" fontSize="24"/>
      <mx:Script>
      <![CDATA[
      private var qt:QT;
      public function init():void

      { qt = new QT(this); }

      ]]
      >
      </mx:Script>

      </mx:WindowedApplication>

      2. which QT.as as follows:
      package
      {
      import flash.events.*;
      import flash.utils.Timer;
      import mx.formatters.DateFormatter;

      public class QT
      {

      private var GER9:Object;
      private var formater:DateFormatter = new DateFormatter();

      public function QT(GER:Object)

      { formater.formatString="YYYY/MM/DD JJ:NN:SS"; this.GER9 = GER; var myTimer:Timer = new Timer(1000, 0); myTimer.addEventListener("timer", timerHandler); myTimer.start(); }

      public function timerHandler(event:TimerEvent):void

      { var now:Date = new Date(); this.GER9.time_label.text = formater.format(now.toLocaleString()); }

      }
      }
      3.

      Actual Results:
      when profile this projet, it seem's many String object was created .

      Expected Results:
      I think there should be nothing when loitering Object between two memory snapshot

      Workaround (if any):

      Attachments

        Activity

          People

            Unassigned Unassigned
            adobejira Adobe JIRA
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated: