Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

References to released media objects are not cleared #248

Closed
AgDude opened this issue Aug 21, 2019 · 1 comment
Closed

References to released media objects are not cleared #248

AgDude opened this issue Aug 21, 2019 · 1 comment
Labels

Comments

@AgDude
Copy link
Contributor

AgDude commented Aug 21, 2019

Bug Report

Problem

Within Media.js a reference to every media object is stored in the mediaObjects object. When the resources are released the reference remains. This leads to a slow memory leak when many sounds are played. In our use case there are many short sounds which we play repeatedly (sometimes releasing in between), each time a new Media instance is created (even for the same sound file) a new record is added to mediaObjects, and never removed.

What is expected to happen?

There is no memory footprint for released media objects.

What does actually happen?

A small memory footprint remains

Environment, Platform, Device

I have observed this as a problem in Android, but it impacts all platforms

Version information

5.0.3

Checklist

  • [ X] I searched for existing GitHub issues
  • [X ] I updated all Cordova tooling to most recent version
  • [X ] I included all the necessary information above

I will provide a pull request shortly to address this issue.

AgDude added a commit to AgDude/cordova-plugin-media that referenced this issue Aug 21, 2019
@timbru31 timbru31 added the bug label Apr 2, 2020
primerib added a commit to primerib/cordova-plugin-media that referenced this issue Jun 12, 2020
@numerized
Copy link

Hi here, can you explain your
#9e56363 fix ?

uaza pushed a commit to quiply/cordova-plugin-media that referenced this issue Oct 22, 2020
)

Co-authored-by: Nate Dudenhoeffer <agdude@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants