File tree Expand file tree Collapse file tree 2 files changed +4
-8
lines changed
Expand file tree Collapse file tree 2 files changed +4
-8
lines changed Original file line number Diff line number Diff line change @@ -331,9 +331,12 @@ var LibraryHtml5WebGL = {
331331 } ,
332332
333333 emscripten_webgl_destroy_context__proxy : 'sync_on_webgl_context_handle_thread' ,
334- emscripten_webgl_destroy_context__deps : [ 'free' ] ,
334+ emscripten_webgl_destroy_context__deps : [ 'free' , '$JSEvents' ] ,
335335 emscripten_webgl_destroy_context : ( contextHandle ) => {
336336 if ( GL . currentContext == contextHandle ) GL . currentContext = 0 ;
337+ // Release all JS event handlers on the DOM element that the GL context is
338+ // associated with since the context is now deleted.
339+ JSEvents . removeAllHandlersOnTarget ( GL . contexts [ contextHandle ] . GLctx . canvas ) ;
337340 GL . deleteContext ( contextHandle ) ;
338341 } ,
339342
Original file line number Diff line number Diff line change @@ -1179,13 +1179,6 @@ 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
1183- if ( typeof JSEvents == 'object' ) {
1184- // Release all JS event handlers on the DOM element that the GL context is
1185- // associated with since the context is now deleted.
1186- JSEvents . removeAllHandlersOnTarget ( GL . contexts [ contextHandle ] . GLctx . canvas ) ;
1187- }
1188- #endif
11891182 // Make sure the canvas object no longer refers to the context object so
11901183 // there are no GC surprises.
11911184 if ( GL . contexts [ contextHandle ] ?. GLctx . canvas ) {
You can’t perform that action at this time.
0 commit comments