diff options
author | Alon Zakai <alonzakai@gmail.com> | 2012-04-18 18:13:27 -0700 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2012-04-18 18:13:27 -0700 |
commit | adde613fd2c04af97d189132609582d46f07b5cf (patch) | |
tree | 4a913e0c930725fc26af0672f9ec0fbbe74e55d4 /tests | |
parent | b89463c712d84b4fe28ae86198266690edd26e45 (diff) |
do not exit the runtime if doing anything async
Diffstat (limited to 'tests')
-rw-r--r-- | tests/emscripten_api_browser.cpp | 8 |
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; |