0 Replies Latest reply on Feb 24, 2008 11:10 PM by Gamelearn

    newObject and Garbage Collection

    Gamelearn
      I've been having some issues with Flash objects, created with newObject, apparently disappearing in mid script and I am wondering if this is the result of the Flash garbage collector disposing of them.
      The script is reasonably intensive, with flash objects created at the start of the script. Randomly the script will fail and crash the projector. Debugging with WinDbg reveals that the issue is a Memory Access Violation / Null Pointer Exception.
      Getting each of the flash objects created with newObject to store a reference to itself in an array on the root timeline, of the embedded flash movie, seems to have solved the problem (perhaps by coincidence) which got me wondering: how does the flash garbage collector know not to dispose of objects created with newObject since they would have no references to other objects within the flash movie and would thus appear disposable by the garbage collector?