From 32976f9136da35b87275b95f4d0258e033df68c0 Mon Sep 17 00:00:00 2001 From: Alistair Smith Date: Wed, 4 Jun 2025 16:23:56 -0700 Subject: [PATCH] change --- src/bun.js/bindings/webcore/Worker.cpp | 4 +--- src/bun.js/web_worker.zig | 6 ++---- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/src/bun.js/bindings/webcore/Worker.cpp b/src/bun.js/bindings/webcore/Worker.cpp index e6c34998f2..ae338145a3 100644 --- a/src/bun.js/bindings/webcore/Worker.cpp +++ b/src/bun.js/bindings/webcore/Worker.cpp @@ -271,9 +271,7 @@ void Worker::terminate() auto* impl = lifecycleHandle_; lifecycleHandle_ = nullptr; - if (impl) { - WebWorkerLifecycleHandle__requestTermination(impl); - } + WebWorkerLifecycleHandle__requestTermination(impl); } // const char* Worker::activeDOMObjectName() const diff --git a/src/bun.js/web_worker.zig b/src/bun.js/web_worker.zig index 7798ae55dc..a973f645d1 100644 --- a/src/bun.js/web_worker.zig +++ b/src/bun.js/web_worker.zig @@ -449,10 +449,8 @@ fn unhandledError(this: *WebWorker, _: anyerror) void { this.flushLogs(); } -pub export fn WebWorkerLifecycleHandle__requestTermination(handle: *WebWorkerLifecycleHandle) void { - if (@intFromPtr(handle) == 0) return; - - handle.requestTermination(); +pub export fn WebWorkerLifecycleHandle__requestTermination(handle: ?*WebWorkerLifecycleHandle) void { + handle.?.requestTermination(); } fn spin(this: *WebWorker) void {