Closures-cleaning-example is a project mainly written in ActionScript, it's free.
Techniques for cleaning up after closures in Flash (preventing memory leaks)
This example is an overview of various mechanisms to remove listeners to closures in Flash, thus preventing memory leaks.
Check out the blog post.
Run the various closure techniques via the application using Flashbuilder's Profiler. Check the usage of the MyTimer
class (which is what we're testing). It will increase into a hundred instances (for each item) for all tests, and then after running GC manually, will decrease back to 0 instances.
Flashbuilder: Run the following maven goal to generate the project files from the pom.
mvn org.sonatype.flexmojos:flexmojos-maven-plugin:3.9:flashbuilder
IntelliJ: Use the import wizard
To build on your machine via Maven. Follow these steps:
Ensure Maven 3.0.3 + is installed
Install local dependencies (add them to your local repository)
cd libs
mvn install:install-file
-Dfile=as3-signals-0.8.swc
-DgroupId=org.osflash
-DartifactId=as3-signals
-Dversion=0.8
-Dpackaging=swc
Build
mvn clean install