remove viewer.destroy() from some tests

This commit is contained in:
Tom 2023-06-29 17:06:45 -04:00
parent 83ec2bb1f0
commit 3a5a738508
3 changed files with 21 additions and 13 deletions

View File

@ -197,7 +197,7 @@
// Delete all our created resources // Delete all our created resources
gl.deleteBuffer(this._glUnitQuadBuffer); gl.deleteBuffer(this._glUnitQuadBuffer);
gl.deleteBuffer(this._glFrameBuffer); gl.deleteFramebuffer(this._glFrameBuffer);
// TO DO: if/when render buffers or frame buffers are used, release them: // TO DO: if/when render buffers or frame buffers are used, release them:
// gl.deleteRenderbuffer(someRenderbuffer); // gl.deleteRenderbuffer(someRenderbuffer);
// gl.deleteFramebuffer(someFramebuffer); // gl.deleteFramebuffer(someFramebuffer);
@ -749,9 +749,17 @@
let gl = this._gl; let gl = this._gl;
let canvas = tileContext.canvas; let canvas = tileContext.canvas;
try{
if(!canvas){
throw('Tile context does not have a canvas', tileContext);
}
// This depends on gl.TEXTURE_2D being bound to the texture // This depends on gl.TEXTURE_2D being bound to the texture
// associated with this canvas before calling this function // associated with this canvas before calling this function
gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, canvas); gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, canvas);
} catch (e){
$.console.error('Error uploading image data to WebGL', e);
}
} }

View File

@ -19,9 +19,9 @@
if (viewer && viewer.close) { if (viewer && viewer.close) {
viewer.close(); viewer.close();
} }
if (viewer && viewer.destroy){ // if (viewer && viewer.destroy){
viewer.destroy(); // viewer.destroy();
} // }
viewer = null; viewer = null;
} }

View File

@ -42,12 +42,12 @@
resetTestVariables(); resetTestVariables();
if ( viewer && viewer.close ) { // if ( viewer && viewer.close ) {
viewer.close(); // viewer.close();
} // }
if (viewer && viewer.destroy){ // if (viewer && viewer.destroy){
viewer.destroy(); // viewer.destroy();
} // }
viewer = null; viewer = null;
} }