]> git.kaiwu.me - njs.git/commitdiff
QuickJS: ignoring rejected promises while destroying context.
authorDmitry Volyntsev <xeioex@nginx.com>
Tue, 8 Apr 2025 01:28:50 +0000 (18:28 -0700)
committerDmitry Volyntsev <xeioexception@gmail.com>
Tue, 8 Apr 2025 05:14:16 +0000 (22:14 -0700)
nginx/ngx_js.c

index ba0fee927c0bd76030dce1a584dbbb4fa7814ef2..316a2076c90dc95dea5476322c280d7ab429a168 100644 (file)
@@ -1155,6 +1155,8 @@ ngx_engine_qjs_destroy(ngx_engine_t *e, ngx_js_ctx_t *ctx,
                           "js unhandled rejection: %V", &exception);
         }
 
+        JS_SetHostPromiseRejectionTracker(JS_GetRuntime(cx), NULL, NULL);
+
         class_id = JS_GetClassID(ngx_qjs_arg(ctx->args[0]));
         opaque = JS_GetOpaque(ngx_qjs_arg(ctx->args[0]), class_id);
         opaque->external = NULL;