Skip to content

Commit

Permalink
Fix assertion failure when Worker is shutting down
Browse files Browse the repository at this point in the history
  • Loading branch information
Jarred-Sumner committed Nov 25, 2023
1 parent 0abe374 commit 22818e6
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/bun.js/bindings/ZigGlobalObject.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -874,8 +874,9 @@ GlobalObject::~GlobalObject()
finalizer(toNapi(this), napiInstanceData, napiInstanceDataFinalizerHint);
}

delete m_subtleCrypto;
scriptExecutionContext()->removeFromContextsMap();
if (auto *ctx = scriptExecutionContext()) {
ctx->removeFromContextsMap();
}
}

void GlobalObject::destroy(JSCell* cell)
Expand Down

0 comments on commit 22818e6

Please sign in to comment.