Skip to content

Commit 0bcf7bb

Browse files
Mark Hendersonfwang
authored andcommitted
docs: clarify inline cleanup comment per review feedback
1 parent 434ac09 commit 0bcf7bb

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

packages/opencode/src/share/share-next.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,9 @@ export namespace ShareNext {
2525
disposed: false,
2626
}),
2727
async (s) => {
28-
// Perform cleanup inline to avoid calling state() during Instance disposal.
29-
// Calling state() here could reinitialize after the Instance has been disposed.
28+
// Perform cleanup inline using the provided state object.
29+
// We cannot call the exported dispose() function here because it calls state(),
30+
// which could reinitialize after the Instance has been disposed.
3031
s.disposed = true
3132
for (const unsub of s.subscriptions) {
3233
unsub()

0 commit comments

Comments
 (0)