From bb36f2e6bcfd20c6a412c135c0b449100cf30cba Mon Sep 17 00:00:00 2001 From: Zef Hemel Date: Tue, 30 May 2023 16:28:52 +0200 Subject: [PATCH] Close connections properly --- web/cm_plugins/collab.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/web/cm_plugins/collab.ts b/web/cm_plugins/collab.ts index 57f0988a..730c1b93 100644 --- a/web/cm_plugins/collab.ts +++ b/web/cm_plugins/collab.ts @@ -46,8 +46,12 @@ export class CollabState { } stop() { - this.collabProvider.disconnect(); + // this.collabProvider.disconnect(); + console.log("[COLLAB] Destroying collab provider"); this.collabProvider.destroy(); + // For whatever reason, destroy() doesn't properly clean up everything so we need to help a bit + this.collabProvider.configuration.websocketProvider.webSocket = null; + this.collabProvider.configuration.websocketProvider.destroy(); } collabExtension(): Extension {