After researching Application Domains, I understand now that this is 
not a bug.

The following post by Roger Gonzalez really helped to explain what I 
was doing wrong: 

http://blogs.adobe.com/rgonzalez/2006/06/applicationdomain.html

Using the following code is NOT recommended:

    Info.load( ApplicationDomain.currentDomain );

This places the Module's "factory" class definition in the SAME app 
domain as Flex.  You cannot remove it once its loaded unless you shut 
down your main Flex application.

The reason I was confused is because I misunderstood the difference 
between the above code and this code:

    Info.load( new ApplicationDomain( 
ApplicationDomain.currentDomain ) );
    
which is eqivalent to (see mx.modules.ModuleManager line 459):

    Info.load();

By creating a "new" app domain, the "factory" class definition is now 
separated from the main Flex app domain.  This new domain is 
a "child" underneath the Flex app domain. When the Module 
(TestModule) is unloaded, I believe it causes the "child" app domain 
to go out of scope allowing it to also be GC'd.

Gaurav: Thanks for testing this and helping me.  I really appreciate 
it.



Reply via email to