In HTML5 platform with html5_canvas_resize set to false, after sapp_run() finishes and you resize the Window, you will get lots of javascript errors, such as:
I am trying to make a HTML page where you can test multiple sokol apps, each one app calls sapp_run() and take ownership of the canvas and at some point the app ends. To have this work properly sapp_run() should always cleanup nicely so the next sokol_run() can run.
Problem
In HTML5 platform with
html5_canvas_resize
set tofalse
, aftersapp_run()
finishes and you resize the Window, you will get lots of javascript errors, such as:Solution
Adding this line to
_sapp_emsc_unregister_eventhandlers
fixes the issue:Use case
I am trying to make a HTML page where you can test multiple sokol apps, each one app calls
sapp_run()
and take ownership of the canvas and at some point the app ends. To have this work properlysapp_run()
should always cleanup nicely so the nextsokol_run()
can run.