3 Replies Latest reply on Aug 18, 2010 2:51 PM by Flex harUI

    Loading/unloading sub-application's RSLs

    ilya_k Level 1

      Greetings!

       

      Main application  which is not linked with RSL_A loads into child application domain sub-application which is linked with RSL_A.

      I assume that RSL_A will be loaded into first frame during sub-application load.

       

      Question: will RSL_A remain in memory after main application unloads sub-app. Logically RSL_A should go away. Is it true?

       

      Thanks,

      _Ilya

        • 1. Re: Loading/unloading sub-application's RSLs
          Flex harUI Adobe Employee

          RSL_A should unload.  Make sure it actually did get loaded into the child

          appdomain.

          • 2. Re: Loading/unloading sub-application's RSLs
            ilya_k Level 1

            Thanks Alex. I like your concise and unambiguous  answers!

             

            In the scenario I described above, I am guessing sub-app and RSL_A both load into child application domain.

            Isn't true or there is some glitch when it might not happen?

             

            _Ilya

            • 3. Re: Loading/unloading sub-application's RSLs
              Flex harUI Adobe Employee

              If you're not seeing it unload, I would double-check the code that loads the

              RSL.  I'm not sure how much testing we did with such a configuration.  Any

              code that assumes the applicationDomain can get fooled in these kinds of

              scenarios.  For example, if you had code that loaded a SWF in some class

              like this:

               

              Class RSLLoader

              {

                  static public function loadRSL(url:String):void

                  {

                      var loader:Loader = new Loader();

                      loader.load(new URLRequest(url), new LoaderContext(false,

              ApplicationDomain.currentDomain);

                  }

              }

               

              And that class is also in the main app, then if the sub-app uses that class

              to load an RSL it will go into the main app's appdomain because the class is

              owned by the main app's appdomain.

               

              Another reason it wouldn't unload is if it still has references because it

              registered a class with a Singleton or something like that.