Yes, unfortunately the FlashProfiler can only take me so far before I have to
switch to Scout and as you rightly say it's not so good for locating what is
holding references.
So some background first.
Explorer is an Actionscript component extending VBox. It's added to a
SuperTabNavigator (FlexLib one) using the following code:
private function AddExplorer(loadInitialTool:Boolean=true,
initialToolEvent:ShellEvent=null):void {
var newChild:Container = CreateExplorer();
if (newChild is IExplorer) {
IExplorer(newChild).LoadInitialTool =
loadInitialTool;
if (initialToolEvent)
IExplorer(newChild).InitialToolEvent =
initialToolEvent;
}
tabNavigator.addChildAt(newChild,
tabNavigator.numChildren);
SetMultipleTabsCloseable();
}
private function CreateExplorer():Container {
var explorer:Container = new
Configuration.Factory.Explorer();
explorer.addEventListener(FlexEvent.CREATION_COMPLETE,
ExplorerCreated);
return explorer;
}
Not the tidiest (mixtures of concrete and interface usage) but nothing
complicated.
I suspected something to do with last thing thing that had focus too but
couldn't determine if that was the case. I have made a bit of progress this
morning in that I can get rid of it now. In the dispose() method I was
manually removing and disposing everything it created. As a last ditch
attempt I shoved a removeAllChildren() at the end and that seems to have got
rid of it!
So from that I'm guessing something that I'm not creating is not getting
cleared for some reason.....
Alex Harui wrote
> I have not used Scout much, and never used Scout for determining _why_
> something is stuck in memory. It isn't clear to me that it is designed to
> do that. The UI and examples seem to be oriented towards showing you
> _what_ is stuck, and can show you the stack at the time of allocation, but
> doesn't appear to show you back-references like Flash Builder.
>
> Is Explorer a display object? If so, all of its children are pointing to
> it, and so are its parents. If one child is stuck in memory because it
> added an event listener to the stage or was the last widget with focus,
> Explorer will be stuck as well. Or did you remove all children?
>
> Is Explorer created from an MXML tag? If so, the containing MXML file
> likely has references to Explorer as well.
>
> Trying to comment out large sections of your app to reduce allocations so
> Flash Builder can show you back-references may still be worth considering.
>
> HTH,
> -Alex
--
View this message in context:
http://apache-flex-users.2333346.n4.nabble.com/Using-Adobe-Scout-to-locate-memory-leak-tp7770p7962.html
Sent from the Apache Flex Users mailing list archive at Nabble.com.