What does "AL lib: alc_cleanup: 1 device not closed" mean?

I am trying to get myself into the scope of OpenGL Libgdx. I used LwjglApplicationto create simple applications that display fields, some meshes, and some textures. I came across an Aurelien Ribon application that creates Box2D rigid bodies. He used LwjglCanvasto integrate with Java Swing. I tried to do it myself, I created JFrameand then added LwjglCanvas. Then set the JFramedefault value to EXIT_ON_CLOSE.

However, whenever I close the application, this leads to my console:

AL lib: alc_cleanup: 1 device not closed.

I do not know what this means, and it does no harm to me. I just want to know what that means. According to the LwjglCanvasdocs:

All OpenGL calls are done on the EDT. This is slightly less efficient then a dedicated thread, but greatly simplifies synchronization. Note that you may need to call stop() or a Swing application may deadlock on System.exit due to how LWJGL and/or Swing deal with shutdown hooks.

Where should I bind LwjglCanvas.stop(), should I add it to the queue, EventDispatchThreador should I bind it to JFrame.addWindowListener?

And what does "AL lib: alc_cleanup: 1 device not closed" mean?

Thank you so much!

+5
source share
3 answers

AL lib is the "audio library" used by Libgdx (a variation of OpenAL).

I believe that this message simply means that the audio library clears some (in your case only one) audio streams / knobs for you. If you see this when exiting, then it will be harmless, since all resources will be cleaned up by the OS.

If you first clear your sound before exiting, the message should disappear.

See alc_cleanuphere for more details : http://repo.or.cz/w/openal-soft.git/blob/HEAD:/Alc/ALc.c

+4
source

AL.destroy(); . finally, System.exit(0), , .

+8

:

Gdx.app.exit();

pause(), .

, , , , . , , , JNI OpenAL, , . , , . JavaDoc, exit():

[s] . pause() dispose() , .

+6
source

All Articles