Skip to content

Commit

Permalink
Merge pull request #13 from hackmdio/fix/destroy-ydoc-after-persistin…
Browse files Browse the repository at this point in the history
…g-in-worker

fix: destroy `ydoc` after persisting to prevent memory leaks in worker
  • Loading branch information
stanley2058 authored Jan 14, 2025
2 parents 5502db9 + 8a837ea commit f8cf03f
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/api.js
Original file line number Diff line number Diff line change
Expand Up @@ -317,6 +317,8 @@ export class Api {
} catch (e) {
console.error(e)
}
// destroy ydoc after persisting
ydoc.destroy()
}
}))
return tasks
Expand Down

0 comments on commit f8cf03f

Please sign in to comment.