Spicefactory Forum Index Spicefactory
Forum Archive
 
 SearchSearch    Log inLog in 

View never disconnected from Parsley

 
Post new topic   Reply to topic    Spicefactory Forum Index -> Spicefactory
View previous topic :: View next topic  
Author Message
koroner



Joined: 15 Oct 2012
Posts: 11

PostPosted: Fri May 17, 2013 12:36 am    Post subject: View never disconnected from Parsley Reply with quote

Hello,

I am experiencing some strange behaviour when using the <Configure/> tag with Parsley 2.4.

There's a class Panel with this code:

Code:

<?xml version="1.0"?>
<s:VGroup xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:s="library://ns.adobe.com/flex/spark" xmlns:parsley="http://www.spicefactory.org/parsley" xmlns:mx="library://ns.adobe.com/flex/mx">

    <fx:Declarations>
        <parsley:Configure/>
    </fx:Declarations>

    <fx:Script><![CDATA[
        import mkr.test.pm.MainPM;

        import mx.collections.ArrayCollection;

        [Inject]
        [Bindable]
        public var model: MainPM;

        public function generateContent(): void {
            container.removeAllElements();
            var subPanel: SubPanel = new SubPanel();
            container.addElement(subPanel);
        }


        ]]></fx:Script>

    <s:Label text="PANEL" />
    <s:Label text="{model.text}" />

    <s:VGroup id="container">
    </s:VGroup>

</s:VGroup>


... and the class SubPanel:

Code:

<?xml version="1.0"?>
<s:VGroup xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:s="library://ns.adobe.com/flex/spark" xmlns:parsley="http://www.spicefactory.org/parsley" xmlns:mx="library://ns.adobe.com/flex/mx" xmlns:view="mkr.test.view.*">

    <fx:Declarations>
        <parsley:Configure />
    </fx:Declarations>

    <fx:Script><![CDATA[
        import mkr.test.pm.MainPM;

        import mx.controls.Alert;

        [Inject]
        [Bindable]
        public var model: MainPM;

        ]]></fx:Script>

    <s:Label text="SUBPANEL" />
    <s:Label text="{model.subText}" />

</s:VGroup>


If I call the method generateContent() repeatedly, it should create a new SubPanel and throw away the previous instance. However, every SubPanel instance stays in the memory forever. This isn't happening if I use FastInject instead of Configure (and everything is fine). But I'd like to use Configure - so what am I doing wrong? Shouldn't the SubPanel be detached from Parsley structures after removing from the stage?

Thanks in advance for any reply,

Koroner
Back to top
View user's profile Send private message
koroner



Joined: 15 Oct 2012
Posts: 11

PostPosted: Fri May 17, 2013 8:29 am    Post subject: Reply with quote

Let me clarify one thing -- after the SubPanel gets removed from its parent, it is unregistered from the Context, but a reference to it seems to be held somewhere, because it doesn't get destroyed (even after garbage collection). Any ideas?
Back to top
View user's profile Send private message
rattkin



Joined: 10 May 2011
Posts: 154
Location: Poznan, PL

PostPosted: Fri May 17, 2013 9:14 am    Post subject: Reply with quote

Wild guess - maybe it has something to do with the same model type you're using (MainPM). Try a different class in SubPanel.s
_________________
Sebastian Zarzycki
Feerie Software
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Spicefactory Forum Index -> Spicefactory All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group