Make sure VBOTracker reset the current tracker when GLContext.useContext(null) is called

This commit is contained in:
Elias Naur 2004-07-24 16:34:07 +00:00
parent 20537ab57e
commit 6330f8e001
2 changed files with 6 additions and 1 deletions

View File

@ -234,6 +234,7 @@ public final class GLContext {
if (did_auto_load)
unloadOpenGLLibrary();
currentContext = null;
VBOTracker.setCurrent(null);
return;
}
// Is this the same as last time?

View File

@ -71,7 +71,11 @@ class VBOTracker {
* @param context
*/
static synchronized void setCurrent(Object context) {
current_tracker = (VBOTracker) contextToTracker.get(context);
if (context == null) {
current_tracker = null;
return;
}
current_tracker = (VBOTracker)contextToTracker.get(context);
if (current_tracker == null) {
current_tracker = new VBOTracker();
contextToTracker.put(context, current_tracker);