2 Replies Latest reply on Nov 4, 2009 6:10 AM by psperkins

    IModuleInfo's factory create method returning null

    psperkins

      I have IModuleInfo objects stored for dynamic loading/unloading of Modules in my application. These IModuleInfo's are retrieved , and have their factory's (IFlexModuleFactory) create method called to create an instance of the module. This works fine most of the time. However, on rapid switching between modules (unloading and loading new instances multiple times, quickly) this fails.

       

      In code:

       

      info:IModuleInfo =     ...  // retrieve IModuleInfo from some data structure

       

      // test that it info is not null

       

      var instance:Object = info.factory.create();

       

      if ( instance is a module) {

       

           // This almost always is the case

       

      }

      else{

       

           // instance is null here.

           // This happens on occasion when rapidly unloading/loading modules

       

      }

       

      Has anyone ever seen this behavior, or have any ideas on what might cause create to return null?