Changed manual null check to a MemoryUtil.getAddressSafe call.

This commit is contained in:
Ioannis Tsakpinis 2011-10-25 17:42:56 +00:00
parent 2482d66ea1
commit 84cd3b562b
1 changed files with 1 additions and 1 deletions

View File

@ -93,7 +93,7 @@ public final class ALC11 {
*/
public static ALCdevice alcCaptureOpenDevice(String devicename, int frequency, int format, int buffersize) {
ByteBuffer buffer = MemoryUtil.encodeASCII(devicename);
long device_address = nalcCaptureOpenDevice((buffer == null) ? 0 : MemoryUtil.getAddress(buffer), frequency, format, buffersize);
long device_address = nalcCaptureOpenDevice(MemoryUtil.getAddressSafe(buffer), frequency, format, buffersize);
if(device_address != 0) {
ALCdevice device = new ALCdevice(device_address);
synchronized (ALC10.devices) {