Jump to content
GreenSock

Search In
  • More options...
Find results that contain...
Find results in...
bob

Having trouble unloading with VideoLoader

Recommended Posts

Hi,

First, thanks for the great products. Greensock is the first 3rd-party tweening library I've used, and I love it.

I have an AIR application that contains about 25 videos. Every time we play a video, we unload the last video. The problem is the video object is not being garbage-collected after we call unload. It's staying in memory. By the time we've played all 25 of our videos, memory is approaching 1.5 gigabytes and our program crashes.

This is how we create the VideoLoader:

vloader = new VideoLoader(config.videoAPI+videofs, {name:"video_"+ys+"_"+i, scaleMode:"stretch", load:false, autoPlay:false, smoothing:true, bufferTime: 2});

This is our code to unload it:       

video.loader.cancel();
video.loader.unload();
video.loader.dispose(true);

I imagine all three lines are overkill, but we are trying everything.

Could it be an eventListener that is preventing the memory from being freed?

Thanks,

Bob

Link to post
Share on other sites

Yep, dispose(true) should be all you need (that also calls cancel() and unload() if necessary internally). And yes, you should definitely remove event listeners in order to clear things for GC. 

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    No registered users viewing this page.

×