Skip to content

Commit 5cc2ebd

Browse files
committed
Fixed issue when destroying WebGLRenderer
1 parent 1507dcf commit 5cc2ebd

1 file changed

Lines changed: 1 addition & 6 deletions

File tree

src/renderer/webgl/WebGLRenderer.js

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -400,7 +400,7 @@ var WebGLRenderer = new Class({
400400
var clearColor = config.backgroundColor;
401401
var gl = canvas.getContext('webgl', config.contextCreation) || canvas.getContext('experimental-webgl', config.contextCreation);
402402

403-
if (!gl)
403+
if (!gl || gl.isContextLost())
404404
{
405405
this.contextLost = true;
406406
throw new Error('This browser does not support WebGL. Try using the Canvas pipeline.');
@@ -1890,11 +1890,6 @@ var WebGLRenderer = new Class({
18901890
delete this.nativeTextures[index];
18911891
}
18921892

1893-
if (this.hasExtension('WEBGL_lose_context'))
1894-
{
1895-
this.getExtension('WEBGL_lose_context').loseContext();
1896-
}
1897-
18981893
delete this.gl;
18991894
delete this.game;
19001895

0 commit comments

Comments
 (0)