mirror of
https://github.com/libsdl-org/SDL.git
synced 2026-03-01 06:38:20 +00:00
FS.mkdir() will throw a javascript exception if the scratch directory already
exists, so catch/ignore that.
Wrap the rest of the scratch i/o in a try/catch block; the event will only
send if everything works out.
Wrap some calls from Javascript to the C runtime's free() in an
EMSCRIPTEN_KEEPALIVE function, so that the compiler doesn't optimize the
function out and crash at runtime.
Fixes #14999.
(cherry picked from commit 267e681a0b)