Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix SoundManager handling when no sound devices exist #226

Merged
merged 9 commits into from
Oct 18, 2024
12 changes: 8 additions & 4 deletions src/main/java/org/lwjgl/openal/AL.java
Original file line number Diff line number Diff line change
Expand Up @@ -70,10 +70,14 @@ public static boolean isCreated() {
}

public static void destroy() {
org.lwjgl3.openal.ALC10.alcDestroyContext(alcContext.context);
org.lwjgl3.openal.ALC10.alcCloseDevice(alcDevice.device);
alcContext = null;
alcDevice = null;
if (alcContext != null) {
org.lwjgl3.openal.ALC10.alcDestroyContext(alcContext.context);
alcContext = null;
}
if (alcDevice != null) {
org.lwjgl3.openal.ALC10.alcCloseDevice(alcDevice.device);
alcDevice = null;
}
created = false;
}

Expand Down