diff options
author | Alon Zakai <alonzakai@gmail.com> | 2013-03-22 16:22:16 -0700 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2013-03-22 16:22:16 -0700 |
commit | a8e4801c7d38033fff760ea26a4579aa324e303e (patch) | |
tree | 01c8c9862f7a6e1b60569aa9be97fd2751be8709 /tests/emscripten_api_browser_infloop.cpp | |
parent | 669c786e3554b280e31dcb7bd92931482547dae0 (diff) | |
parent | f99012f271c056ddc171f6a4ec011ad31ad936cd (diff) |
Merge branch 'incoming'
Diffstat (limited to 'tests/emscripten_api_browser_infloop.cpp')
-rw-r--r-- | tests/emscripten_api_browser_infloop.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/tests/emscripten_api_browser_infloop.cpp b/tests/emscripten_api_browser_infloop.cpp index 0fd41922..1e9808da 100644 --- a/tests/emscripten_api_browser_infloop.cpp +++ b/tests/emscripten_api_browser_infloop.cpp @@ -8,17 +8,15 @@ struct Class { int x; Class() : x(0) {} + ~Class() { x = -9999; } void print() { - char buf[18]; - memset(buf, 0, 18); // clear stack. if we did not simulate infinite loop, this clears x and is a bug! - x += buf[7]; - printf("waka %d\n", x++); - if (x == 7) { + if (x == 7 || x < 0) { int result = x; REPORT_RESULT(); + emscripten_cancel_main_loop(); } } @@ -28,7 +26,9 @@ struct Class { void start() { instance = this; - emscripten_set_main_loop(Class::callback, 3, 1); // important if we simulate an infinite loop here or not + // important if we simulate an infinite loop here or not. With an infinite loop, the + // destructor should *NOT* have been called + emscripten_set_main_loop(Class::callback, 3, 1); } }; |