diff --git a/.gitignore b/.gitignore index 99043c5..bd3d33d 100644 --- a/.gitignore +++ b/.gitignore @@ -109,3 +109,5 @@ build/uwp/studio/Debug/ build/uwp/studio/Debug Pro/ build/uwp/studio/Release/ build/uwp/studio/Release Pro/ +build/uwp/studio/ARM/ +build/uwp/studio/x64/ diff --git a/src/jsapi.c b/src/jsapi.c index 5dcc672..0d57f79 100644 --- a/src/jsapi.c +++ b/src/jsapi.c @@ -824,22 +824,13 @@ s32 duk_timeout_check(void* udata) tic_machine* machine = (tic_machine*)udata; tic_tick_data* tick = machine->data; - enum{Wait = 1000}; // 1 sec - - if(ForceExitCounter) - return ForceExitCounter < tick->counter(); - else if(tick->forceExit && tick->forceExit(tick->data)) - ForceExitCounter = tick->counter() + Wait * 1000 / tick->freq(); - - return false; + return ForceExitCounter++ > 1000 ? tick->forceExit && tick->forceExit(tick->data) : false; } static void initDuktape(tic_machine* machine) { closeJavascript((tic_mem*)machine); - ForceExitCounter = 0; - duk_context* duk = machine->js = duk_create_heap(NULL, NULL, NULL, machine, NULL); { @@ -876,6 +867,8 @@ static bool initJavascript(tic_mem* tic, const char* code) static void callJavascriptTick(tic_mem* tic) { + ForceExitCounter = 0; + tic_machine* machine = (tic_machine*)tic; const char* TicFunc = ApiKeywords[0];