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

Remove finalize from JavaSoundAudioClip.java

XMLWordPrintable

      com/sun/media/sound/JavaSoundAudioClip.java uses finalize() to ensure sound resources are cleaned up.
      finalization is deprecated, so this needs to be changed.
      A cleaner/disposer can be used, although it requires some refactoring because
      the JavaSoundAudioClip instance installs listeners on the resources to be cleaned up and those listeners point back to the clip.
      So finalization will work, but not a Disposer.
      The solution seems to be that the JavaSoundAudioClip becomes a wrapper for a delegate that has the real implementation.

            prr Philip Race
            prr Philip Race
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: