Skip to content

Commit

Permalink
Fix SoundManager handling when no sound devices exist (#226)
Browse files Browse the repository at this point in the history
* destroy only when created
  • Loading branch information
Ecdcaeb authored Oct 18, 2024
1 parent 76a8cd4 commit 516c4f1
Showing 1 changed file with 8 additions and 4 deletions.
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

0 comments on commit 516c4f1

Please sign in to comment.