Browse Source

delete all webglProperties on loss of context

Fordy 10 years ago
parent
commit
dfaea63385

+ 2 - 0
src/renderers/WebGLRenderer.js

@@ -184,6 +184,8 @@ THREE.WebGLRenderer = function ( parameters ) {
 			setDefaultGLState();
 
 			objects.objects = {};
+			objects.webGLProps.deleteAll();
+			webGLProps.deleteAll();
 
 		}, false);
 

+ 1 - 0
src/renderers/webgl/WebGLObjects.js

@@ -67,6 +67,7 @@ THREE.WebGLObjects = function ( gl, info ) {
 
 	this.objects = objects;
 	this.objectsImmediate = objectsImmediate;
+	this.webGLProps = webGLProps;
 
 	this.geometries = geometries;
 

+ 6 - 0
src/renderers/webgl/WebGLProperties.js

@@ -6,6 +6,12 @@ THREE.WebGLProperties = function () {
 
 	var properties = {};
 
+	this.deleteAll = function () {
+
+		properties = {};
+
+	}
+
 	this.delete = function ( object ) {
 
 		delete properties[ object.uuid ];