From 81554dac615765bf5131189e5035865b976cfae3 Mon Sep 17 00:00:00 2001 From: Leon Krause Date: Sat, 23 Feb 2019 20:06:22 +0100 Subject: Fix file preloading warning in HTML5 platform --- platform/javascript/detect.py | 4 ---- platform/javascript/engine.js | 3 ++- 2 files changed, 2 insertions(+), 5 deletions(-) (limited to 'platform') diff --git a/platform/javascript/detect.py b/platform/javascript/detect.py index c3f3946ee0..3cc79097f8 100644 --- a/platform/javascript/detect.py +++ b/platform/javascript/detect.py @@ -129,10 +129,6 @@ def configure(env): # us since we don't know requirements at compile-time. env.Append(LINKFLAGS=['-s', 'ALLOW_MEMORY_GROWTH=1']) - # Since we use both memory growth and MEMFS preloading, - # this avoids unnecessary copying on start-up. - env.Append(LINKFLAGS=['--no-heap-copy']) - # This setting just makes WebGL 2 APIs available, it does NOT disable WebGL 1. env.Append(LINKFLAGS=['-s', 'USE_WEBGL2=1']) diff --git a/platform/javascript/engine.js b/platform/javascript/engine.js index 91458eb4c3..860d6707ff 100644 --- a/platform/javascript/engine.js +++ b/platform/javascript/engine.js @@ -199,7 +199,8 @@ } LIBS.FS.mkdirTree(dir); } - LIBS.FS.createDataFile('/', file.path, new Uint8Array(file.buffer), true, true, true); + // With memory growth, canOwn should be false. + LIBS.FS.createDataFile(file.path, null, new Uint8Array(file.buffer), true, true, false); }, this); preloadedFiles = null; -- cgit v1.2.3