ensureStillAlive

This commit is contained in:
Ciro Spaciari
2025-09-09 16:30:54 -07:00
parent 7753820bd6
commit 3e84a2964d

View File

@@ -404,7 +404,11 @@ pub fn failWithJSValue(this: *MySQLConnection, value: JSValue) void {
loop.enter();
defer loop.exit();
this.globalObject.queueMicrotask(on_close, &[_]JSValue{ value.toError() orelse value, this.getQueriesArray() });
const js_error = value.toError() orelse value;
js_error.ensureStillAlive();
const queries_array = this.getQueriesArray();
queries_array.ensureStillAlive();
this.globalObject.queueMicrotask(on_close, &[_]JSValue{ js_error, queries_array });
}
pub fn fail(this: *MySQLConnection, message: []const u8, err: AnyMySQLError.Error) void {