RFR: 8365569: Remove finalize from JavaSoundAudioClip.java

Sergey Bylokhov serb at openjdk.org
Fri Aug 15 01:35:10 UTC 2025


On Thu, 14 Aug 2025 17:27:09 GMT, Phil Race <prr at openjdk.org> wrote:

> This refactors com/sun/media/sound/JavaSoundAudioClip.java so that most of the implementation is in a delegate
> com/sun/media/sound/JavaSoundAudioClipDelegate.java
> 
> Then a disposer can be used to free the audio resources held by the delegate when the JavaSoundAudioClip becomes unreachable.

How about modifying the listeners list implementations to store listeners using weak references instead(not sure it will be better that the current patch)? it seems current implementation can cause memory leaks?

-------------

PR Comment: https://git.openjdk.org/jdk/pull/26784#issuecomment-3190363350


More information about the client-libs-dev mailing list