Skip to content

Commit 507b455

Browse files
committed
[libwebgl.js] Avoid depending on $JSEvents under MINIMAL_RUNTIME
1 parent 2a38f3b commit 507b455

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/lib/libwebgl.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1179,11 +1179,13 @@ for (/**@suppress{duplicate}*/var i = 0; i <= {{{ GL_POOL_TEMP_BUFFERS_SIZE }}};
11791179
if (GL.currentContext === GL.contexts[contextHandle]) {
11801180
GL.currentContext = null;
11811181
}
1182+
#if !MINIMAL_RUNTIME
11821183
if (typeof JSEvents == 'object') {
11831184
// Release all JS event handlers on the DOM element that the GL context is
11841185
// associated with since the context is now deleted.
11851186
JSEvents.removeAllHandlersOnTarget(GL.contexts[contextHandle].GLctx.canvas);
11861187
}
1188+
#endif
11871189
// Make sure the canvas object no longer refers to the context object so
11881190
// there are no GC surprises.
11891191
if (GL.contexts[contextHandle]?.GLctx.canvas) {

0 commit comments

Comments
 (0)