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

前端 未结 3 895
自闭症患者
自闭症患者 2021-01-02 11:06

I\'m trying to engage myself into the Libgdx OpenGL framework. I\'ve used LwjglApplication for creating some simple apps that render boxes, some meshes and some

相关标签:
3条回答
  • 2021-01-02 11:53

    AL.destroy(); must be called before the application shuts down. this call is normally included in a finally block, but if the application calls System.exit(0), finally blocks are no longer executed.

    0 讨论(0)
  • 2021-01-02 11:55

    You should try always closing your app with the piece of code below:

    Gdx.app.exit();
    

    I usually put it in my pause() method, because there was no reason for my app to run in the background.

    This static method tells the framework that your application is planning on closing and will thus release all resources effectively. The error you're getting is because the JNI interface has loaded an OpenAL library, but the System is closed before that library is properly unloaded and released. I had the same problem as you did, but this solved it. As stated in the JavaDoc, the exit() method:

    Schedule[s] an exit from the application. On android, this will cause a call to pause() and dispose() some time in the future, it will not immediately finish your application.

    0 讨论(0)
  • 2021-01-02 12:04

    The AL lib is the "audio library" used by Libgdx (one of the OpenAL variants).

    I believe this message just means that the audio library is cleaning up some (in your case just one) audio streams/handles for you. If you see this at exit, its harmless as all resources will be cleaned up by the OS.

    If you internally cleanup your audio before exiting, the message should go away.

    For more details, look for alc_cleanup in here: http://repo.or.cz/w/openal-soft.git/blob/HEAD:/Alc/ALc.c

    0 讨论(0)
提交回复
热议问题