@@ -30,6 +30,10 @@
#include <algorithm>
+#ifdef __EMSCRIPTEN__
+#include <emscripten.h>
+#endif
+
using std::istream;
using std::ostream;
using std::string;
@@ -973,6 +977,15 @@ ns_release_all_textures() {
// Blow away the cache of resolved relative filenames.
_relpath_lookup.clear();
+ // Also empty the emscripten preload cache.
+ EM_ASM({
+ if (Module["preloadedImages"]) {
+ Module["preloadedImages"] = {};
+ }
+ });
}
/**