From 3a5a738508f151ca6dfbb915edea8b00d6cc2ca6 Mon Sep 17 00:00:00 2001 From: Tom Date: Thu, 29 Jun 2023 17:06:45 -0400 Subject: [PATCH] remove viewer.destroy() from some tests --- src/webgldrawer.js | 16 ++++++++++++---- test/modules/controls.js | 6 +++--- test/modules/navigator.js | 12 ++++++------ 3 files changed, 21 insertions(+), 13 deletions(-) diff --git a/src/webgldrawer.js b/src/webgldrawer.js index 44daa72a..e61ac8fd 100644 --- a/src/webgldrawer.js +++ b/src/webgldrawer.js @@ -197,7 +197,7 @@ // Delete all our created resources 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: // gl.deleteRenderbuffer(someRenderbuffer); // gl.deleteFramebuffer(someFramebuffer); @@ -749,9 +749,17 @@ let gl = this._gl; let canvas = tileContext.canvas; - // This depends on gl.TEXTURE_2D being bound to the texture - // associated with this canvas before calling this function - gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, canvas); + try{ + if(!canvas){ + throw('Tile context does not have a canvas', tileContext); + } + // This depends on gl.TEXTURE_2D being bound to the texture + // associated with this canvas before calling this function + 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); + } + } diff --git a/test/modules/controls.js b/test/modules/controls.js index 0bf68ea3..35fef74c 100644 --- a/test/modules/controls.js +++ b/test/modules/controls.js @@ -19,9 +19,9 @@ if (viewer && viewer.close) { viewer.close(); } - if (viewer && viewer.destroy){ - viewer.destroy(); - } + // if (viewer && viewer.destroy){ + // viewer.destroy(); + // } viewer = null; } diff --git a/test/modules/navigator.js b/test/modules/navigator.js index 1209b3f8..1523fa63 100644 --- a/test/modules/navigator.js +++ b/test/modules/navigator.js @@ -42,12 +42,12 @@ resetTestVariables(); - if ( viewer && viewer.close ) { - viewer.close(); - } - if (viewer && viewer.destroy){ - viewer.destroy(); - } + // if ( viewer && viewer.close ) { + // viewer.close(); + // } + // if (viewer && viewer.destroy){ + // viewer.destroy(); + // } viewer = null; }