mirror of
git://git.tartarus.org/simon/puzzles.git
synced 2025-04-21 08:01:30 -07:00
wasm/js/emscripten: Fix page loading race
Using a stunt webserver which artificially introduces a 3s delay just before the last line of the HTML output, I have reproduced a uwer-reported loading/startup race bug: Previously the wasm loading was started by the <script> element, synchronously. If the wasm loading is fast, and finishes before the HTML loading, the onRuntimeInitialized event may occur before initPuzzles. But initPuzzles sets up the event handler. Fix this bug, and introduce a new comment containing an argument for the correctness of the new approach. Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
This commit is contained in:

committed by
Simon Tatham

parent
56ef86f92b
commit
77866e1335
@ -43,6 +43,7 @@ endfunction()
|
||||
function(set_platform_puzzle_target_properties NAME TARGET)
|
||||
em_link_pre_js(${TARGET} ${CMAKE_SOURCE_DIR}/emccpre.js)
|
||||
em_link_js_library(${TARGET} ${CMAKE_SOURCE_DIR}/emcclib.js)
|
||||
em_link_post_js(${TARGET} ${CMAKE_SOURCE_DIR}/emccpost.js)
|
||||
endfunction()
|
||||
|
||||
function(build_platform_extras)
|
||||
|
Reference in New Issue
Block a user