Re: UIComponent not removing its event listeners?

2016-02-22 Thread XaviConde
Hi Alex, 

I'm analyzing a simple case, where an About popup dialog is closed but
several of the objects used are still in memory. 

In this case, the About class inherits from TitleWindow, which inherits from
UIComponent. I take memory snapshots before opening the popup and after
closing it. I can see an instance of the class still in memory according to
Loitering Objects. When I inspect the Object References to it, there are
several Function objects created from addEventListener(). Three of these
Function objects were created from UIComponent, as seen in the Allocation
Trace window. So, my understanding is that there are 3 Function objects
which reference my About object, and in order to free them, they should be
destroyed with a removeEventListener() by UIComponent. Is that right, or
they won't be counted as references by the garbage collector...? 

Thanks in advance.



--
View this message in context: 
http://apache-flex-development.247.n4.nabble.com/UIComponent-not-removing-its-event-listeners-tp51608p51661.html
Sent from the Apache Flex Development mailing list archive at Nabble.com.


Re: [FlexJS][FalconJX] Proxy Support

2016-02-22 Thread piotrz
Hi Alex,

Constructor Proxy class for JS compilation has strange description. Probably
mistake.

Piotr



-
Apache Flex PMC
piotrzarzyck...@gmail.com
--
View this message in context: 
http://apache-flex-development.247.n4.nabble.com/FlexJS-FalconJX-Proxy-Support-tp51658p51662.html
Sent from the Apache Flex Development mailing list archive at Nabble.com.


Re: [FlexJS] Tree Component

2016-02-22 Thread jude
+1 great work

On Fri, Feb 19, 2016 at 10:31 AM, Peter Ent  wrote:

> Hi,
>
> I've just finished adding a new component to the FlexJS HTML package:
> Tree. The Tree component is completely based on List and uses a new data
> model, HierarchicalData, found in the FlexJS Collections package.
>
> You can read more about Tree on the FlexJS Wiki (
> https://cwiki.apache.org/confluence/display/FLEX/Tree) as well as try it
> using the FlexJS example, TreeExample, found in the flex-asjs/examples,
> repository.
>
> The itemRenderer for the Tree is fairly basic, but should provide you with
> enough to make something more complex.
>
> Regards,
> Peter Ent
> Adobe Systems/Apache Flex Project
>


Re: [7/7] git commit: [flex-sdk] [refs/heads/develop] - FLEX-35031 FLEX-33058 -Simplified algorithm in findAny() and findLast(). -Improved asdoc for these functions. Note that all tests still pass.

2016-02-22 Thread Mihai Chira
Great, thank you Josh! I just made the changes.

On 17 February 2016 at 20:05, Josh Tynjala  wrote:
> "You can add content to the comment before the @inheritDoc tag."
>
> Source:
> http://help.adobe.com/en_US/flex/using/WSd0ded3821e0d52fe1e63e3d11c2f44bc36-7ff6.html
>
> I previously ran into this issue when I was documenting Feathers. Extra
> text after @inheritDoc seems to be ignored. You need to put it before
> @inheritDoc.
>
> - Josh
>
>
> On Wed, Feb 17, 2016 at 9:11 AM, Mihai Chira  wrote:
>
>> asdocs question: does anyone know if it's possible what was attempted
>> in mx.collections.HierarchicalCollectionViewCursor.findAny() (and two
>> other functions), namely to add some extra information on top of the
>> @inheritDoc taken from the interface? Because when I look at our
>> asdocs [1], HierarchicalCollectionViewCursor.findAny() only has the
>> description defined in mx.collections.IViewCursor.findAny(), and none
>> of the extra info added in HierarchicalCollectionViewCursor.findAny().
>> Thanks.
>>
>> [1] http://flex.apache.org/asdoc/index.html
>>
>> On 17 February 2016 at 17:00,   wrote:
>> > FLEX-35031 FLEX-33058
>> > -Simplified algorithm in findAny() and findLast().
>> > -Improved asdoc for these functions.
>> > Note that all tests still pass.
>> >
>> >
>> > Project: http://git-wip-us.apache.org/repos/asf/flex-sdk/repo
>> > Commit: http://git-wip-us.apache.org/repos/asf/flex-sdk/commit/22f81c47
>> > Tree: http://git-wip-us.apache.org/repos/asf/flex-sdk/tree/22f81c47
>> > Diff: http://git-wip-us.apache.org/repos/asf/flex-sdk/diff/22f81c47
>> >
>> > Branch: refs/heads/develop
>> > Commit: 22f81c478a097a019b2f714d1d85f3200ce69fb4
>> > Parents: 0f811ec
>> > Author: Mihai Chira 
>> > Authored: Wed Feb 17 16:38:46 2016 +0100
>> > Committer: Mihai Chira 
>> > Committed: Wed Feb 17 16:38:46 2016 +0100
>> >
>> > --
>> >  .../HierarchicalCollectionViewCursor.as | 21
>> ++--
>> >  .../framework/src/mx/collections/IViewCursor.as | 18 -
>> >  2 files changed, 19 insertions(+), 20 deletions(-)
>> > --
>> >
>> >
>> >
>> http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/22f81c47/frameworks/projects/advancedgrids/src/mx/collections/HierarchicalCollectionViewCursor.as
>> > --
>> > diff --git
>> a/frameworks/projects/advancedgrids/src/mx/collections/HierarchicalCollectionViewCursor.as
>> b/frameworks/projects/advancedgrids/src/mx/collections/HierarchicalCollectionViewCursor.as
>> > index 15584ff..8b85e58 100644
>> > ---
>> a/frameworks/projects/advancedgrids/src/mx/collections/HierarchicalCollectionViewCursor.as
>> > +++
>> b/frameworks/projects/advancedgrids/src/mx/collections/HierarchicalCollectionViewCursor.as
>> > @@ -310,7 +310,8 @@ public class HierarchicalCollectionViewCursor
>> extends EventDispatcher
>> >   *  @inheritDoc
>> >   *
>> >   *  Note that for this class, the view does not need to be
>> sorted in order to
>> > - *  call this method.
>> > + *  call this method. Also, if the item cannot be found, the cursor
>> location is
>> > + *  left on the last queried object.
>> >   *
>> >   *  @langversion 3.0
>> >   *  @playerversion Flash 9
>> > @@ -321,14 +322,12 @@ public class HierarchicalCollectionViewCursor
>> extends EventDispatcher
>> >  {
>> >  seek(CursorBookmark.FIRST);
>> >
>> > -var done:Boolean = false;
>> > -while (!done)
>> > +do
>> >  {
>> >  if (ObjectUtil.valuesAreSubsetOfObject(valuesToMatch,
>> hierarchicalData.getData(current)))
>> >  return true;
>> > -
>> > -done = !moveNext();
>> >  }
>> > +while(moveNext());
>> >
>> >  return false;
>> >  }
>> > @@ -337,7 +336,8 @@ public class HierarchicalCollectionViewCursor
>> extends EventDispatcher
>> >   *  @inheritDoc
>> >   *
>> >   *  Note that for this class, the view does not need to be
>> sorted in order to
>> > - *  call this method.
>> > + *  call this method. Also, if the item cannot be found, the cursor
>> location is
>> > + *  left on the last queried object.
>> >   *
>> >   *  @langversion 3.0
>> >   *  @playerversion Flash 9
>> > @@ -353,7 +353,8 @@ public class HierarchicalCollectionViewCursor
>> extends EventDispatcher
>> >   *  @inheritDoc
>> >   *
>> >   *  Note that for this class, the view does not need to be
>> sorted in order to
>> > - *  call this method.
>> > + *  call this method. Also, if the item cannot be found, the cursor
>> location is
>> > + *  left on the last queried object.
>> >   *
>> >   *  @langversion 3.0
>> >   *  @playerversion Flash 9
>> > @@ -364,14 +365,12 @@ public class HierarchicalCollectionViewCursor
>> extends EventDispatcher
>> >  {

Re: [2/7] git commit: [flex-sdk] [refs/heads/develop] - FLEX-35031 -Since I'm planning to use ObjectUtil.isDynamicObject() in the fix, I wanted to unit test it. -Also, I introduced a new function in O

2016-02-22 Thread Mihai Chira
For XML and ObjectProxy - true, and for Proxy - false, according to
the new unit tests I just committed. Does that look all right? I've
never used the Proxy class, and although in the docs it looks like
it's not marked as dynamic (as opposed to ObjectProxy, which is), it
does provide some pretty dynamic functionality...
And yes, the current implementation of isDynamicObject, as donated by
Adobe, seems faster (though I haven't tested it) than describeType,
so, if it yields correct results, I'd be in favour of keeping it this
way.

On 18 February 2016 at 14:26, Mihai Chira  wrote:
> hey Alex, just letting you know I'll get back to you on Monday, when
> I'm working again.
>
> On 18 February 2016 at 07:32, Alex Harui  wrote:
>> Looks like some nice new capabilities for ArrayUtil and ObjectUtil.  Did
>> you rule out using describeType for isDynamicObject?  I know it is slow,
>> but it should always be right.  What should isDynamicObject return for
>> XML, Proxy and ObjectProxy?
>>
>> Thanks,
>> -Alex
>>
>> On 2/17/16, 8:00 AM, "mih...@apache.org"  wrote:
>>
>>>FLEX-35031
>>>-Since I'm planning to use ObjectUtil.isDynamicObject() in the fix, I
>>>wanted to unit test it.
>>>-Also, I introduced a new function in ObjectUtil to be used in the
>>>solution, getEnumerableProperties(), which returns all the dynamic
>>>properties of an object. In order to unit test this new method I needed a
>>>function with which to compare Arrays. So I added it to ArrayUtil,
>>>including the unit tests needed to validate it.
>>>-Also edited an asdoc entry and renamed a function parameter.
>>>
>>>
>>>Project: http://git-wip-us.apache.org/repos/asf/flex-sdk/repo
>>>Commit: http://git-wip-us.apache.org/repos/asf/flex-sdk/commit/680b405d
>>>Tree: http://git-wip-us.apache.org/repos/asf/flex-sdk/tree/680b405d
>>>Diff: http://git-wip-us.apache.org/repos/asf/flex-sdk/diff/680b405d
>>>
>>>Branch: refs/heads/develop
>>>Commit: 680b405dfc4559ecf81239352b5bd9676d00adc8
>>>Parents: e68c148
>>>Author: Mihai Chira 
>>>Authored: Wed Feb 17 13:35:31 2016 +0100
>>>Committer: Mihai Chira 
>>>Committed: Wed Feb 17 13:35:31 2016 +0100
>>>
>>>--
>>> .../framework/src/mx/utils/ArrayUtil.as |  92 ++
>>> .../framework/src/mx/utils/ObjectUtil.as|  33 ++-
>>> .../framework/tests/mx/utils/ArrayUtil_Tests.as | 293 +++
>>> .../tests/mx/utils/ObjectUtil_Tests.as  | 167 +++
>>> 4 files changed, 581 insertions(+), 4 deletions(-)
>>>--
>>>
>>>
>>>http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/680b405d/frameworks/p
>>>rojects/framework/src/mx/utils/ArrayUtil.as
>>>--
>>>diff --git a/frameworks/projects/framework/src/mx/utils/ArrayUtil.as
>>>b/frameworks/projects/framework/src/mx/utils/ArrayUtil.as
>>>index c41cccf..85ec79c 100644
>>>--- a/frameworks/projects/framework/src/mx/utils/ArrayUtil.as
>>>+++ b/frameworks/projects/framework/src/mx/utils/ArrayUtil.as
>>>@@ -107,6 +107,98 @@ public class ArrayUtil
>>>
>>> return -1;
>>> }
>>>+
>>>+/**
>>>+ *  Checks if the Array instances contain the same values
>>>+ *  against the same indexes.
>>>+ *
>>>+ *  @param a The first Array instance.
>>>+ *  @param b The second Array instance.
>>>+ *  @return true if the two Arrays contain the same values
>>>+ *  (determined using the strict equality operator) associated
>>>+ *  with the same indexes.
>>>+ *
>>>+ *  @langversion 3.0
>>>+ *  @playerversion Flash 9
>>>+ *  @playerversion AIR 1.1
>>>+ *  @productversion Flex 3
>>>+ */
>>>+public static function arraysMatch(a:Array, b:Array):Boolean
>>>+{
>>>+if(!a || !b)
>>>+return false;
>>>+
>>>+if(a.length != b.length)
>>>+return false;
>>>+
>>>+var indexesA:Array = ObjectUtil.getEnumerableProperties(a);
>>>+
>>>+for (var i:int = 0; i < indexesA.length; i++)
>>>+{
>>>+var index:String = indexesA[i];
>>>+
>>>+if(!b.hasOwnProperty(index) || a[index] !== b[index])
>>>+return false;
>>>+}
>>>+
>>>+return true;
>>>+}
>>>+
>>>+/**
>>>+ *  Checks if the Array instances contain the same values,
>>>+ *  even if in different orders.
>>>+ *
>>>+ *  @param a The first Array instance.
>>>+ *  @param b The second Array instance.
>>>+ *  @return true if the two Arrays contain the same values.
>>>+ *
>>>+ *  @langversion 3.0
>>>+ *  @playerversion Flash 9
>>>+ *  @playerversion AIR 1.1
>>>+ *  @productversion Flex 3
>>>+ */
>>>+public static function arrayValuesMatch(a:Array, b:Array):Boolean
>>>+{
>>>+if(!a || !b)
>>>+return false;
>>>+
>>>+var valuesOfA:Array = getArrayValues(a);
>>>+valuesOfA.sort(

Re: [2/7] git commit: [flex-sdk] [refs/heads/develop] - FLEX-35031 -Since I'm planning to use ObjectUtil.isDynamicObject() in the fix, I wanted to unit test it. -Also, I introduced a new function in O

2016-02-22 Thread Alex Harui


On 2/22/16, 3:26 AM, "Mihai Chira"  wrote:

>For XML and ObjectProxy - true, and for Proxy - false, according to
>the new unit tests I just committed. Does that look all right? I've
>never used the Proxy class, and although in the docs it looks like
>it's not marked as dynamic (as opposed to ObjectProxy, which is), it
>does provide some pretty dynamic functionality...

Right, that's the question.  You can often add arbitrary properties to a
Proxy.  But I think I just learned that Proxy is essentially an Abstract
class and any subclass of it must be marked Dynamic so I think you are ok
here.

Thanks for checking,
-Alex



Re: UIComponent not removing its event listeners?

2016-02-22 Thread Alex Harui


On 2/22/16, 12:24 AM, "XaviConde"  wrote:

>Hi Alex, 
>
>I'm analyzing a simple case, where an About popup dialog is closed but
>several of the objects used are still in memory.
>
>In this case, the About class inherits from TitleWindow, which inherits
>from
>UIComponent. I take memory snapshots before opening the popup and after
>closing it. I can see an instance of the class still in memory according
>to
>Loitering Objects. When I inspect the Object References to it, there are
>several Function objects created from addEventListener(). Three of these
>Function objects were created from UIComponent, as seen in the Allocation
>Trace window. So, my understanding is that there are 3 Function objects
>which reference my About object, and in order to free them, they should be
>destroyed with a removeEventListener() by UIComponent. Is that right, or
>they won't be counted as references by the garbage collector...?

They won't be counted by the GC.  When analyzing references, the only ones
that matter are ones that lead away from the object towards another object
that isn't in turn referenced by a chain leading to a GC Root.

And sometimes it is the children of a dialog that have the reference chain
back to GC Root.

If you want, you can post links to screen snapshots of the profiler output
and we can try to help you decipher it.  Make sure there aren't any
company confidential class names in the screenshots before you post them.
You can obfuscate them if you want.

-Alex



Re: [2/7] git commit: [flex-sdk] [refs/heads/develop] - FLEX-35031 -Since I'm planning to use ObjectUtil.isDynamicObject() in the fix, I wanted to unit test it. -Also, I introduced a new function in O

2016-02-22 Thread Mihai Chira
> class and any subclass of it must be marked Dynamic so I think you are ok
> here.

Phew :)

Thanks,
Mihai


Re: UIComponent not removing its event listeners?

2016-02-22 Thread XaviConde
Thanks Alex. I'm working on a sample project to expose the problems we're
having. I'll create a new thread about it tomorrow.

Regards!



--
View this message in context: 
http://apache-flex-development.247.n4.nabble.com/UIComponent-not-removing-its-event-listeners-tp51608p51669.html
Sent from the Apache Flex Development mailing list archive at Nabble.com.


[FlexJS] Storage

2016-02-22 Thread Peter Ent
I've added a new project to FlexJS: Storage. This one is aimed at providing 
short- and long-term storage for FlexJS apps. In this commit is an 
implementation of LocalStorage for Flash and browser platforms. Its pretty 
simple, but I hope will be useful to you for simple storage between sessions.

I will be expanding this project to include a way to store files.

Thanks,
Peter Ent
Adobe Systems/Apache Flex project