Skip to content

Commit

Permalink
call awareness.destroy when destroying the provider, refs #769 (#771)
Browse files Browse the repository at this point in the history
  • Loading branch information
janthurau authored Jan 4, 2024
1 parent 3b1c01d commit 1a1168a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion packages/provider/src/HocuspocusProvider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -477,9 +477,10 @@ export class HocuspocusProvider extends EventEmitter {

if (this.awareness) {
removeAwarenessStates(this.awareness, [this.document.clientID], 'provider destroy')
this.awareness.off('update', this.awarenessUpdateHandler)
this.awareness.destroy()
}

this.awareness?.off('update', this.awarenessUpdateHandler)
this.document.off('update', this.documentUpdateHandler)

this.removeAllListeners()
Expand Down

0 comments on commit 1a1168a

Please sign in to comment.