diff --git a/src/java/org/lwjgl/test/openal/BasicTest.java b/src/java/org/lwjgl/test/openal/BasicTest.java index ee8f87dd..f4006fe5 100644 --- a/src/java/org/lwjgl/test/openal/BasicTest.java +++ b/src/java/org/lwjgl/test/openal/BasicTest.java @@ -119,6 +119,27 @@ public abstract class BasicTest { } } + /** + * Shutdowns OpenAL + */ + protected void alExit() { + + //Get active context + context = alc.getCurrentContext(); + + //Get device for active context + device = alc.getContextsDevice(context); + + //Disable context + alc.makeContextCurrent(null); + + //Release context(s) + alc.destroyContext(context); + + //Close device + alc.closeDevice(device); + } + /** * Creates an integer buffer to hold specified ints * - strictly a utility method @@ -140,7 +161,7 @@ public abstract class BasicTest { */ protected void exit(int error) { System.out.println("OpenAL Error: " + al.getString(error)); - alut.exit(); + alExit(); System.exit(-1); } } \ No newline at end of file