Skip to content

Commit

Permalink
Fix null safety in AL.destroy
Browse files Browse the repository at this point in the history
  • Loading branch information
eigenraven committed Jan 20, 2024
1 parent c95fa5f commit 786d3c4
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/main/java/org/lwjglx/openal/AL.java
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,12 @@ public static boolean isCreated() {
}

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

0 comments on commit 786d3c4

Please sign in to comment.