aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2014-05-02 11:05:04 -0700
committerAlon Zakai <alonzakai@gmail.com>2014-05-02 11:05:04 -0700
commitf25f2fa17a59182b34e5f68f725ef14b7c7f38a6 (patch)
tree3a2b2a7d0136802fdcc01b5b4bc70fa72a8c8f37 /src
parent0c96ee7315fda2dba5f2fde084cd31fa227dfb72 (diff)
document and assert on only one browser main loop at a time
Diffstat (limited to 'src')
-rw-r--r--src/library_browser.js2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/library_browser.js b/src/library_browser.js
index 5cc7e122..44e8c473 100644
--- a/src/library_browser.js
+++ b/src/library_browser.js
@@ -889,6 +889,8 @@ mergeInto(LibraryManager.library, {
emscripten_set_main_loop: function(func, fps, simulateInfiniteLoop, arg) {
Module['noExitRuntime'] = true;
+ assert(!Browser.mainLoop.scheduler, 'there can only be one main loop function at once: call emscripten_cancel_main_loop to cancel the previous one, if you want to');
+
Browser.mainLoop.runner = function Browser_mainLoop_runner() {
if (ABORT) return;
if (Browser.mainLoop.queue.length > 0) {