I'd have to poke through it to be sure, but it should.  Fundamentally, all that 
should be going on there is this:

CairngormNameChangedToProtectTheInnocentModel.getInstance().uploadsFromFoo.addEventListener("result",
 bindingCallback, false, 0, true);

Where bindingCallback looks like:

private function bindingCallback(event:Event):void
{
                uploadFromFoo.dataProvider = 
CairngormNameChangedToProtectTheInnocentModel.getInstance().uploadsFromFoo.result
}

There should not be any strong references from 
CairngormNameChangedToProtectTheInnocentModel to the DataGrid.

It gets a bit more tricky with the way MXML generates code and we've found bugs 
in there in the past, but the ones I've explored recently haven't been a 
problem.

Alex Harui
Flex SDK Developer
Adobe Systems Inc.<http://www.adobe.com/>
Blog: http://blogs.adobe.com/aharui

From: [email protected] [mailto:[email protected]] On Behalf 
Of Gregor Kiddie
Sent: Friday, May 01, 2009 1:38 AM
To: [email protected]
Subject: RE: [flexcoders] Unloading Modules - Binding is the Enemy?




Hang on, now I'm confused...
Does this code result in a weak reference binding?

<mx:DataGrid id = "uploadFromFoo"
            width = "100%"
            height = "100%"
            dataProvider = "{ 
CairngormNameChangedToProtectTheInnocentModel.getInstance().uploadsFromFoo }"
            allowMultipleSelection = "false"
            change = "viewHelper.uploadSelectionChange()"
            editable = "false">

I was always led to believe it wouldn't.

Gregor Kiddie
Senior Developer
INPS

Tel:       01382 564343
Registered address: The Bread Factory, 1a Broughton Street, London SW8 3QJ
Registered Number: 1788577
Registered in the UK

Visit our Internet Web site at www.inps.co.uk<blocked::http://www.inps.co.uk/>

The information in this internet email is confidential and is intended solely 
for the addressee. Access, copying or re-use of information in it by anyone 
else is not authorised. Any views or opinions presented are solely those of the 
author and do not necessarily represent those of INPS or any of its affiliates. 
If you are not the intended recipient please contact [email protected]

________________________________
From: [email protected] [mailto:[email protected]] On Behalf 
Of Alex Harui
Sent: 28 April 2009 21:24
To: [email protected]
Subject: RE: [flexcoders] Unloading Modules - Binding is the Enemy?





A weak reference listener is attached to myAc.  It shouldn't matter what its 
type is (as long as it isn't XML).  The selectedChild of a ViewStack will have 
a reference to the ModuleLoader child which should have a reference to the 
module.  Not sure how you are attempting to unload that module, but once that 
gets cleaned up, the module should go away.  The profiler should help you see 
what is hanging onto the module.

The profiler should also give you good info on who's hanging onto the editable 
copy.

Are you comfortable with working with the Profiler?  Have you looked at the 
profiler "tutorial" on my blog?

Alex Harui
Flex SDK Developer
Adobe Systems Inc.<http://www.adobe.com/>
Blog: http://blogs.adobe.com/aharui


Reply via email to