0 Replies Latest reply on Jul 15, 2014 1:10 PM by Joevenile

    Unloading CModule possible? flascc, crossbridge, #1074, flascc.as3_id2rcv

    Joevenile

      Hi all,

       

      This is really starting to drive me crazy. Perhaps this is a misuse of flascc/crossbridge...

       

      Basically I am trying to load various flascc compiled swfs - the problem I am having is that I either:

       

      1) Leak domain memory and byte array memory (according to Scout) if I do nothing to clear up the CModule settings on exit.

      2) I do not leak memory if I do the following:

       

      CModule.rootSprite = null;      // I think this is not needed.

      CModule.activeConsole = null;      // causes illegal write to read-only property ...flascc.as3_id2rcv on global;

      CModule.vfs.console = null; // Think this is essentially alias of above

      CModule.vfs = null; // Doesn't seem to cause issues, and does free some memory

       

      But, setting activeConsole to null will cause a #1074 read-only property error (on loading a different flascc swf) - but if I do not do this on loading a *different* flascc swf I get the error "Error: calling startAsync with an active console".

       

      I have a parent swf that will load in these flascc compiled swfs (parent swf is regular as3) - each child swf will set itself up as the active console and call startAsync. There will only be one flascc compiled swf running at once.

       

      Is it possible to initialise a flascc swf, unload it, and initialise another one? I mean, without leaking memory. Do I need to do anything to reset the flash c++ runtime?

       

      Thanks,

      Joe