Any object in the module listening to a shared model in the main app is a 
potential leak, the model now has  a reference to the listening object.  
Hopefully you used weak reference listeners there.

The profiler should be able to tell you what is holding onto your module.

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 Battershall, Jeff
Sent: Wednesday, April 22, 2009 7:28 AM
To: [email protected]
Subject: RE: [flexcoders] DataGrid Children Prevent Module Unload?




Thanks Pedro,

In my AIR app, the user can logout and login, with the available modules being 
tied to their profile. If I were to shut the app down on logout, all my 
problems would be solvied, because we'd be starting from scratch.  But that 
seems less than terrific user experience so I'm trying to hit the holy grail of 
all modules unloaded on logout, with the app still running.

Problem is, of course, that when something prevents the module unload, the app 
springs a memory leak.   I had thought that injecting the model into the module 
was the solution, by creating an interface for modules. This was based upon a 
presentation by Borre Wessel 
(http://blogs.adobe.com/borre/Modularizing_Flex_Cairngorm_and_Modules.pdf).  
However, I must not be following his advice in some fashion, because what I'm 
doing isn't working.  My module's model needs to be strongly typed in order to 
set up the necessary bindings between the model and the components, but the 
interface to inject the model would be via interface.  The question becomes 
exactly how do you update the model when you retrieve data via Delegate?  I 
have tried passing a weak reference to the module's model in my Caringorm event 
classes and then casting it as the strong typed local version the module 
requires, but no dice so far.

Jeff
-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf 
Of Pedro Sena
Sent: Wednesday, April 22, 2009 9:57 AM
To: [email protected]
Subject: Re: [flexcoders] DataGrid Children Prevent Module Unload?
Hmmm,

If you are using Cairngorm + Modules take a look at Modular

http://lab.arc90.com/2007/10/modular_1.php

This problem is not the only one that you will face when working with Cairngorm 
+ Modules, trust me

HTH,

Pedro Sena
On Wed, Apr 22, 2009 at 10:32 AM, Battershall, Jeff 
<[email protected]<mailto:[email protected]>> wrote:

I've done a bit more research.  At this point it doesn't appear to be the 
renderers - I took them out for testing and it looks like that the way I'm 
injecting model objects into Module that might be at fault.  Right now, I've 
defined a model interface that I'm passing back to the Commands inside of the 
Cairngorm events.  I'm kind of hacking my way through this.

Driving me crazy, though.  Shouldn't be rocket science to unload a freakin' 
module.

Jeff
-----Original Message-----
From: [email protected]<mailto:[email protected]> 
[mailto:[email protected]<mailto:[email protected]>] On 
Behalf Of Pedro Sena
Sent: Wednesday, April 22, 2009 9:04 AM
To: [email protected]<mailto:[email protected]>
Subject: Re: [flexcoders] DataGrid Children Prevent Module Unload?
Hi Jeff,

Do your renderers have some reference to module data?

How are your grid and your module related?

I think we need more info to help you.

Regards,

Pedro Sena
On Wed, Apr 22, 2009 at 9:03 AM, Battershall, Jeff 
<[email protected]<mailto:[email protected]>> wrote:


I'm using the profiler to get handle on what's causing a given module to
fail to unload and it appears that the datagrid is the culprit.
Specifically when the data grid is unpopulated, I can successfully
unload the module. When it is populated, it won't. I have the datagrid
bound to a local model object. It appears that as soon as the datagrid
has children, the module won't unload completely.

There must be some reference that the datagrid has that is causing this
- I am using some custom item renderers/editors. Any advice greatly
appreciated.

Jeff Battershall
Application Architect
Dow Jones Indexes
[email protected]<mailto:jeff.battershall%40dowjones.com>
(609) 520-5637 (p)
(484) 477-9900 (c)


--
/**
* Pedro Sena
* Systems Architect
* Sun Certified Java Programmer
* Sun Certified Web Component Developer
*/



--
/**
* Pedro Sena
* Systems Architect
* Sun Certified Java Programmer
* Sun Certified Web Component Developer
*/

Reply via email to