aboutsummaryrefslogtreecommitdiff
path: root/tests/emscripten_api_browser.cpp
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2012-04-18 18:13:27 -0700
committerAlon Zakai <alonzakai@gmail.com>2012-04-18 18:13:27 -0700
commitadde613fd2c04af97d189132609582d46f07b5cf (patch)
tree4a913e0c930725fc26af0672f9ec0fbbe74e55d4 /tests/emscripten_api_browser.cpp
parentb89463c712d84b4fe28ae86198266690edd26e45 (diff)
do not exit the runtime if doing anything async
Diffstat (limited to 'tests/emscripten_api_browser.cpp')
-rw-r--r--tests/emscripten_api_browser.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/tests/emscripten_api_browser.cpp b/tests/emscripten_api_browser.cpp
index 37ffbdd6..4d425120 100644
--- a/tests/emscripten_api_browser.cpp
+++ b/tests/emscripten_api_browser.cpp
@@ -1,5 +1,6 @@
#include<stdio.h>
#include<math.h>
+#include<stdlib.h>
#include<SDL.h>
#include<emscripten.h>
#include<assert.h>
@@ -26,11 +27,18 @@ void second() {
}
+void never() {
+ int result = 0;
+ REPORT_RESULT();
+}
+
int main() {
SDL_Init(0);
last = SDL_GetTicks();
printf("frist! %d\n", last);
+ atexit(never); // should never be called - it is wrong to exit the runtime orderly if we have async calls!
+
emscripten_async_call(second, 500);
return 1;