Skip to content

Commit

Permalink
Merge pull request #35 from jacobdoran/patch-1
Browse files Browse the repository at this point in the history
Fixed event listener memory leak
  • Loading branch information
dmonad authored Feb 14, 2021
2 parents 4239124 + 8359016 commit 914a6d0
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/plugins/cursor-plugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,8 @@ export const yCursorPlugin = (awareness, { cursorBuilder = defaultCursorBuilder,
return {
update: updateCursorInfo,
destroy: () => {
view.dom.removeEventListener('focusin', updateCursorInfo)
view.dom.removeEventListener('focusout', updateCursorInfo)
awareness.off('change', awarenessListener)
awareness.setLocalStateField(cursorStateField, null)
}
Expand Down

0 comments on commit 914a6d0

Please sign in to comment.