mirror of
https://github.com/photonstorm/phaser
synced 2025-02-17 14:38:30 +00:00
Fixed issue when destroying WebGLRenderer
This commit is contained in:
parent
1507dcf448
commit
5cc2ebd6be
1 changed files with 1 additions and 6 deletions
|
@ -400,7 +400,7 @@ var WebGLRenderer = new Class({
|
|||
var clearColor = config.backgroundColor;
|
||||
var gl = canvas.getContext('webgl', config.contextCreation) || canvas.getContext('experimental-webgl', config.contextCreation);
|
||||
|
||||
if (!gl)
|
||||
if (!gl || gl.isContextLost())
|
||||
{
|
||||
this.contextLost = true;
|
||||
throw new Error('This browser does not support WebGL. Try using the Canvas pipeline.');
|
||||
|
@ -1890,11 +1890,6 @@ var WebGLRenderer = new Class({
|
|||
delete this.nativeTextures[index];
|
||||
}
|
||||
|
||||
if (this.hasExtension('WEBGL_lose_context'))
|
||||
{
|
||||
this.getExtension('WEBGL_lose_context').loseContext();
|
||||
}
|
||||
|
||||
delete this.gl;
|
||||
delete this.game;
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue