remove context from the devices list of context on context destroy

This commit is contained in:
Brian Matzon 2007-05-19 20:47:53 +00:00
parent 4ec5e9994f
commit fc845268e6
2 changed files with 13 additions and 0 deletions

View file

@ -359,6 +359,8 @@ public final class ALC10 {
synchronized(ALC10.contexts) {
nalcDestroyContext(getContext(context));
context.setInvalid();
ALCdevice device = alcGetContextsDevice(context);
device.removeContext(context);
}
}
native static void nalcDestroyContext(long context);

View file

@ -89,6 +89,17 @@ public final class ALCdevice {
contexts.put(new Long(context.context), context);
}
}
/**
* Remove context associated with device
*
* @param context Context to disassociate with device
*/
void removeContext(ALCcontext context) {
synchronized (contexts) {
contexts.remove(new Long(context.context));
}
}
/**
* Marks this device and all of its contexts invalid