|
-
Total Universe Mod
That's technically valid albeit a bit sloppy.
You cannot manually remove items from memory, only the garbage collector can do that. Nullifying merely makes things eligible for garbage collection. The key GC eligibility is removing all references. Nullifying the parent class instance removes it as the only reference to its properties (in most cases) thus eliminating the need to clear each property individually. You of course have to stop all playing movie clips, remove any listeners, shut down all streams any other logical activity before nullifying the parent. Having a public function called destroy() is common practice.
myParentClass.destroy();
myParentClass = null;
Newer versions of the flash player are better at doing a lot of this along with letting you trigger the garbage collector on command but until you're familiar with how that works, this is a good practice.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|