moved invalidation into sycnhronized block
This commit is contained in:
parent
325ad04c7e
commit
4ec5e9994f
|
@ -221,8 +221,8 @@ public final class ALC10 {
|
||||||
*/
|
*/
|
||||||
public static boolean alcCloseDevice(ALCdevice device) {
|
public static boolean alcCloseDevice(ALCdevice device) {
|
||||||
boolean result = nalcCloseDevice(getDevice(device));
|
boolean result = nalcCloseDevice(getDevice(device));
|
||||||
device.setInvalid();
|
|
||||||
synchronized (devices) {
|
synchronized (devices) {
|
||||||
|
device.setInvalid();
|
||||||
devices.remove(new Long(device.device));
|
devices.remove(new Long(device.device));
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
|
@ -253,8 +253,8 @@ public final class ALC10 {
|
||||||
ALCcontext context = new ALCcontext(context_address);
|
ALCcontext context = new ALCcontext(context_address);
|
||||||
synchronized (ALC10.contexts) {
|
synchronized (ALC10.contexts) {
|
||||||
contexts.put(new Long(context_address), context);
|
contexts.put(new Long(context_address), context);
|
||||||
}
|
|
||||||
device.addContext(context);
|
device.addContext(context);
|
||||||
|
}
|
||||||
return context;
|
return context;
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
|
@ -356,9 +356,11 @@ public final class ALC10 {
|
||||||
* @param context address of context to Destroy
|
* @param context address of context to Destroy
|
||||||
*/
|
*/
|
||||||
public static void alcDestroyContext(ALCcontext context) {
|
public static void alcDestroyContext(ALCcontext context) {
|
||||||
|
synchronized(ALC10.contexts) {
|
||||||
nalcDestroyContext(getContext(context));
|
nalcDestroyContext(getContext(context));
|
||||||
context.setInvalid();
|
context.setInvalid();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
native static void nalcDestroyContext(long context);
|
native static void nalcDestroyContext(long context);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -109,8 +109,8 @@ public final class ALC11 {
|
||||||
*/
|
*/
|
||||||
public static boolean alcCaptureCloseDevice(ALCdevice device) {
|
public static boolean alcCaptureCloseDevice(ALCdevice device) {
|
||||||
boolean result = nalcCaptureCloseDevice(ALC10.getDevice(device));
|
boolean result = nalcCaptureCloseDevice(ALC10.getDevice(device));
|
||||||
device.setInvalid();
|
|
||||||
synchronized (ALC10.devices) {
|
synchronized (ALC10.devices) {
|
||||||
|
device.setInvalid();
|
||||||
ALC10.devices.remove(new Long(device.device));
|
ALC10.devices.remove(new Long(device.device));
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
|
|
Loading…
Reference in New Issue