Release MovieGlRef memory

** Reposting from old forum **

Hey folks.

I’m making an osx app that needs to play a series of clips. I’ve noticed that i very quickly start leaking as the clip is swapped over time. I’ve made an isolated case that makes a vector of MovieGlRefs and plays one at a time in sequence and can see the mem consumption rise.

So my question, what is the best way to release that memory?

Hey - are you freeing popping the MovieGlRefs off of the vector as they complete? AVFoundation definitely does its own internal caching that we don’t have any control over, so memory usage growing during playback doesn’t surprise me. Is your current theory that the ~MovieGl destructor is never firing, or something else?


I think it is the AVFoundation being greedy. It seems if i ::create a new instance into the save var it clears things out as expected.