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

BindingUtils.bindProperty(useWeakReference) doesn't bind correctly.

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Cannot Reproduce
    • Affects Version/s: Adobe Flex SDK 4.0 (Release)
    • Fix Version/s: Adobe Flex SDK Previous
    • Component/s: Data Binding
    • Labels:
      None
    • Environment:
      Affected OS(s): All OS Platforms
      Affected OS(s): All OS Platforms
      Language Found: English

      Description

      Build this AIR app:
      <?xml version="1.0" encoding="utf-8"?>
      <s:WindowedApplication xmlns:fx="http://ns.adobe.com/mxml/2009"
      xmlns:s="library://ns.adobe.com/flex/spark"
      xmlns:mx="library://ns.adobe.com/flex/mx"
      xmlns:comp="components.*" width="200" height="200" creationComplete="onCreationComplete(event)">

      <fx:Script>
      <![CDATA[
      import mx.binding.utils.BindingUtils;
      import mx.events.FlexEvent;

      protected function button1_clickHandler(event:MouseEvent):void

      { System.gc(); }

      protected function onCreationComplete(event:FlexEvent):void

      { BindingUtils.bindProperty(myLabel, "text", myEdit, "text", false, true); }

      ]]
      >
      </fx:Script>

      <s:SkinnableContainer width="100%" height="100%">
      <s:VGroup gap="10">
      <s:Button label="GC" click="button1_clickHandler(event)" />
      <s:TextInput id="myEdit"/>
      <s:Label id="myLabel"/>
      </s:VGroup>
      </s:SkinnableContainer>
      </s:WindowedApplication>

      Run the app.
      Type in the editbox(the label should update to show the same text as the editbox)
      Click the GC button.
      Type in the editbox

      Actual Results:
      Running the garbage collector destroys the binding.

      Expected Results:
      Binding remains after GC runs.

      Workaround (if any):
      Setting the weak reference flag to false works around the bug, but also defeats the weak reference I wanted...

        Attachments

          Activity

            People

            • Assignee:
              adobejira Adobe JIRA
              Reporter:
              adobejira Adobe JIRA
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: