diff --git a/execute_jsc.c b/execute_jsc.c index 707bbce..420b303 100644 --- a/execute_jsc.c +++ b/execute_jsc.c @@ -319,6 +319,7 @@ bool proxy_execute_jsc_global_cleanup(void) { dlclose(g_proxy_execute_jsc.module); memset(&g_proxy_execute_jsc, 0, sizeof(g_proxy_execute_jsc)); + g_proxy_execute_jsc_init_flag = PTHREAD_ONCE_INIT; return true; } diff --git a/execute_jscore.c b/execute_jscore.c index 73f8211..a5245be 100644 --- a/execute_jscore.c +++ b/execute_jscore.c @@ -489,6 +489,9 @@ bool proxy_execute_jscore_global_cleanup(void) { dlclose(g_proxy_execute_jscore.module); memset(&g_proxy_execute_jscore, 0, sizeof(g_proxy_execute_jscore)); + + static const pthread_once_t proxy_execute_jscore_init_flag = PTHREAD_ONCE_INIT; + memcpy(&g_proxy_execute_jscore_init_flag, &proxy_execute_jscore_init_flag, sizeof(proxy_execute_jscore_init_flag)); return true; }