diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/postamble.js | 3 | ||||
-rw-r--r-- | src/preamble.js | 3 |
2 files changed, 4 insertions, 2 deletions
diff --git a/src/postamble.js b/src/postamble.js index 8f585b86..cd892733 100644 --- a/src/postamble.js +++ b/src/postamble.js @@ -35,9 +35,10 @@ var preloadStartTime = null; var calledMain = false; var calledRun = false; -dependenciesFulfilled = function() { +dependenciesFulfilled = function runCaller() { // If run has never been called, and we should call run (INVOKE_RUN is true, and Module.noInitialRun is not false) if (!calledRun && shouldRunNow) run(); + if (!calledRun) dependenciesFulfilled = runCaller; // try this again later, after new deps are fulfilled } Module['callMain'] = Module.callMain = function callMain(args) { diff --git a/src/preamble.js b/src/preamble.js index 02935f8f..8e70cb74 100644 --- a/src/preamble.js +++ b/src/preamble.js @@ -993,8 +993,9 @@ function removeRunDependency(id) { runDependencyWatcher = null; } if (dependenciesFulfilled) { - dependenciesFulfilled(); + var callback = dependenciesFulfilled; dependenciesFulfilled = null; + callback(); // can add another dependenciesFulfilled } } } |