diff --git a/src/runtime/js.zig b/src/runtime/js.zig index fab5f246..e1a577c6 100644 --- a/src/runtime/js.zig +++ b/src/runtime/js.zig @@ -389,18 +389,18 @@ pub fn Env(comptime S: type, comptime types: anytype) type { // `gc_hints` option is enabled, we'll use the `lowMemoryNotification` // call on the isolate to encourage v8 to free the context. pub fn stopExecutor(self: *Self, executor: *Executor) void { - executor.deinit(); - self.executor_pool.destroy(executor); - if (self.gc_hints) { - self.isolate.lowMemoryNotification(); - } - if (comptime builtin.mode == .Debug) { if (executor.kind == .main) { std.debug.assert(self.has_executor == true); self.has_executor = false; } } + + executor.deinit(); + self.executor_pool.destroy(executor); + if (self.gc_hints) { + self.isolate.lowMemoryNotification(); + } } // Give it a Zig struct, get back a v8.FunctionTemplate.