Skip to content

Commit f8cf03f

Browse files
authored
Merge pull request #13 from hackmdio/fix/destroy-ydoc-after-persisting-in-worker
fix: destroy `ydoc` after persisting to prevent memory leaks in worker
2 parents 5502db9 + 8a837ea commit f8cf03f

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/api.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -317,6 +317,8 @@ export class Api {
317317
} catch (e) {
318318
console.error(e)
319319
}
320+
// destroy ydoc after persisting
321+
ydoc.destroy()
320322
}
321323
}))
322324
return tasks

0 commit comments

Comments
 (0)