Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8101978

Add explicit dispose() method to MediaPlayer

    Details

      Backports

        Description

        Add explicit dispose() method to MediaPlayer.

        Explicit dispose() method is needed to free native resources used by MediaPlayer. Garbage collector is not reliable enough to free native resources fast enough, thus when MediaPlayers are created fast enough we may run out of native memory. Normally, user does not need to call dispose() method on MediaPlayer if application does not create them often. After dispose() is called MediaPlayer cannot be used again and should be disregarded. Media and MediaView associated with disposed MediaPlayer can be reused. Dispose() will be valid in any states. For example, when player is playing call to dispose() will stop playback and release all resources.

          Attachments

            Issue Links

              Activity

                People

                • Assignee:
                  almatvee Alexander Matveev
                  Reporter:
                  almatvee Alexander Matveev
                • Votes:
                  1 Vote for this issue
                  Watchers:
                  13 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved:
                    Imported: