libgdx / gdx-video

A libGDX cross platform video rendering extension
Apache License 2.0
147 stars 50 forks source link

Close the video buffer after using it in iOS #89

Closed lucas-kakele closed 7 months ago

lucas-kakele commented 8 months ago

If the buffer is not closed, I believe a memory leak is occurring, and GC runs frequently (once every a few seconds in the device I tested, iPhone 7).

Empirically, I tried using "close" and also "release". The first one did the trick.

This change is also based on the documentation that mentions the buffer should be released after use: https://developer.apple.com/documentation/avfoundation/avplayeritemvideooutput/1386148-copypixelbufferforitemtime#return_value