diff options
author | Sven Gothel <[email protected]> | 2023-10-03 02:23:54 +0200 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2023-10-03 02:23:54 +0200 |
commit | 69549319e1d9ddf4d3903aa077f2c4cebb54195e (patch) | |
tree | 5792466d4391d73305b1b4245143b87f57494f74 /src/demos | |
parent | e8c3c0382d58c8eabf4b96aa555683252c10d569 (diff) |
GraphUI Scene: Add custom one-time GLRunnable disposable action list, allowing to properly take-down user resources at dispose(GLAutoDrawable)
Used for UISceneDemo20 to stop and release SimpleSineSynth and its ALAudioSink.
The latter causes a bad exit (crash at OpenAL32.dll) on OpenJDK's Window Binary if not stopped!
Diffstat (limited to 'src/demos')
-rw-r--r-- | src/demos/com/jogamp/opengl/demos/graph/ui/UISceneDemo20.java | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/demos/com/jogamp/opengl/demos/graph/ui/UISceneDemo20.java b/src/demos/com/jogamp/opengl/demos/graph/ui/UISceneDemo20.java index 56aeb861c..2942dd58a 100644 --- a/src/demos/com/jogamp/opengl/demos/graph/ui/UISceneDemo20.java +++ b/src/demos/com/jogamp/opengl/demos/graph/ui/UISceneDemo20.java @@ -765,6 +765,10 @@ public class UISceneDemo20 implements GLEventListener { } if( true ) { final SimpleSineSynth sineSound = new SimpleSineSynth(); + scene.addDisposeAction((final GLAutoDrawable glad) -> { + sineSound.stop(); + return true; + } ); sineSound.setFreq(200f); sineSound.setAmplitude(0.1f); final Button sineButton = new Button(renderModes, fontButtons, "lala", buttonRWidth, buttonRHeight); |