RE: [flexcoders] PopUpButton issue

2008-01-16 Thread Deepa Subramaniam
There were intricacies with the PopUpManager logic which, I think, led
to this solution. The framework changelist (available on labs) would
have more details. 

 



From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of Scott Melby
Sent: Wednesday, January 16, 2008 12:47 PM
To: flexcoders@yahoogroups.com
Subject: Re: [flexcoders] PopUpButton issue

 

Deepa - 

Thanks!  It seems you could avoid the memory leak without nulling _popUp
couldn't you?  i.e. just call PopUpManager.removePopUp(_popUp) without
the following line that nulls the reference.  Is that not right?

Scott



Scott Melby
Founder, Fast Lane Software LLC
http://www.fastlanesw.com



Deepa Subramaniam wrote: 

This chunk of code was added on purpose, to avoid problematic memory
leaks with popup components. In Jira you can see it was fixed to address
SDK bug 13104. We were not correctly unregistering popup children when
necessary. Your workaround is correct, so feel safe using it :) 

https://bugs.adobe.com/jira/browse/SDK-13104
<https://bugs.adobe.com/jira/browse/SDK-13104>  

-Original Message-
From: flexcoders@yahoogroups.com <mailto:flexcoders%40yahoogroups.com>
[mailto:flexcoders@yahoogroups.com <mailto:flexcoders%40yahoogroups.com>
] On
Behalf Of Scott Melby
Sent: Wednesday, January 16, 2008 5:38 AM
To: flexcoders@yahoogroups.com <mailto:flexcoders%40yahoogroups.com> 
Subject: [flexcoders] PopUpButton issue

I have a PopUpButton on which I am setting a Menu as the popUp 
property. I have found that the popUp attribute is being nulled when 
the PopUpButton is removed from the stage... which causes my button to 
not function properly when added back to the stage. I traced the issue 
to the following code in PopUpButton.as which appears to be incorrect. 
In this code the _popUp member (backing for the popUp setters and 
getters) is nulled.

private function removedFromStageHandler(event:Event):void
{
// Ensure we've unregistered ourselves from PopupManager, else
// we'll be leaked.
if (_popUp) {
PopUpManager.removePopUp(_popUp);
_popUp = null;
}
}

To workaround this issue I had to listen for the addedToStage event in 
my view that uses this component and re-set the popUp property each time

as follows.

/**
* Called each time this view is added to the stage. We 
need this to work
* around an issue where the PopUpButton has a null popUp
* property each time it has been removed from the stage.
*/
public function handleAddedToStage():void{
if(this.createButton != null && this._buttonMenu !=
null){
this.createButton.popUp = _buttonMenu;
}
}

Has anybody else seen this? Can somebody please let me know if this is 
a bug in the toolkit? The workaround works fine... but seems like it 
should not be necessary.

Thanks
Scott

-- 
Scott Melby
Founder, Fast Lane Software LLC
http://www.fastlanesw.com <http://www.fastlanesw.com> 

--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
<http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt> 
Search Archives:
http://www.mail-archive.com/flexcoders%40yahoogroups.com
<http://www.mail-archive.com/flexcoders%40yahoogroups.com>  
Yahoo! Groups Links

 



Re: [flexcoders] PopUpButton issue

2008-01-16 Thread Scott Melby

Deepa -

Thanks!  It seems you could avoid the memory leak without nulling _popUp 
couldn't you?  i.e. just call PopUpManager.removePopUp(_popUp) without 
the following line that nulls the reference.  Is that not right?


Scott

Scott Melby
Founder, Fast Lane Software LLC
http://www.fastlanesw.com



Deepa Subramaniam wrote:


This chunk of code was added on purpose, to avoid problematic memory
leaks with popup components. In Jira you can see it was fixed to address
SDK bug 13104. We were not correctly unregistering popup children when
necessary. Your workaround is correct, so feel safe using it :)

https://bugs.adobe.com/jira/browse/SDK-13104 



-Original Message-
From: flexcoders@yahoogroups.com  
[mailto:flexcoders@yahoogroups.com 
] On

Behalf Of Scott Melby
Sent: Wednesday, January 16, 2008 5:38 AM
To: flexcoders@yahoogroups.com 
Subject: [flexcoders] PopUpButton issue

I have a PopUpButton on which I am setting a Menu as the popUp
property. I have found that the popUp attribute is being nulled when
the PopUpButton is removed from the stage... which causes my button to
not function properly when added back to the stage. I traced the issue
to the following code in PopUpButton.as which appears to be incorrect.
In this code the _popUp member (backing for the popUp setters and
getters) is nulled.

private function removedFromStageHandler(event:Event):void
{
// Ensure we've unregistered ourselves from PopupManager, else
// we'll be leaked.
if (_popUp) {
PopUpManager.removePopUp(_popUp);
_popUp = null;
}
}

To workaround this issue I had to listen for the addedToStage event in
my view that uses this component and re-set the popUp property each time

as follows.

/**
* Called each time this view is added to the stage. We
need this to work
* around an issue where the PopUpButton has a null popUp
* property each time it has been removed from the stage.
*/
public function handleAddedToStage():void{
if(this.createButton != null && this._buttonMenu !=
null){
this.createButton.popUp = _buttonMenu;
}
}

Has anybody else seen this? Can somebody please let me know if this is
a bug in the toolkit? The workaround works fine... but seems like it
should not be necessary.

Thanks
Scott

--
Scott Melby
Founder, Fast Lane Software LLC
http://www.fastlanesw.com 

--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt 


Search Archives:
http://www.mail-archive.com/flexcoders%40yahoogroups.com 


Yahoo! Groups Links

 


RE: [flexcoders] PopUpButton issue

2008-01-16 Thread Deepa Subramaniam
This chunk of code was added on purpose, to avoid problematic memory
leaks with popup components. In Jira you can see it was fixed to address
SDK bug 13104. We were not correctly unregistering popup children when
necessary. Your workaround is correct, so feel safe using it :) 

https://bugs.adobe.com/jira/browse/SDK-13104 

-Original Message-
From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of Scott Melby
Sent: Wednesday, January 16, 2008 5:38 AM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] PopUpButton issue

I have a PopUpButton on which I am setting a Menu as the popUp 
property.  I have found that the popUp attribute is being nulled when 
the PopUpButton is removed from the stage... which causes my button to 
not function properly when added back to the stage.  I traced the issue 
to the following code in PopUpButton.as which appears to be incorrect.  
In this code the _popUp member (backing for the popUp setters and 
getters) is nulled.

private function removedFromStageHandler(event:Event):void
{
// Ensure we've unregistered ourselves from PopupManager, else
// we'll be leaked.
if (_popUp) {
PopUpManager.removePopUp(_popUp);
_popUp = null;
}
}

To workaround this issue I had to listen for the addedToStage event in 
my view that uses this component and re-set the popUp property each time

as follows.

/**
 * Called each time this view is added to the stage.  We 
need this to work
 * around an issue where the PopUpButton has a null popUp
 * property each time it has been removed from the stage.
 */
public function handleAddedToStage():void{
   if(this.createButton != null && this._buttonMenu !=
null){
  this.createButton.popUp = _buttonMenu;
   }
}


Has anybody else seen this?  Can somebody please let me know if this is 
a bug in the toolkit?  The workaround works fine... but seems like it 
should not be necessary.

Thanks
Scott

-- 
Scott Melby
Founder, Fast Lane Software LLC
http://www.fastlanesw.com




--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives:
http://www.mail-archive.com/flexcoders%40yahoogroups.com 
Yahoo! Groups Links