diff --git a/front/src/Phaser/Game/GameScene.ts b/front/src/Phaser/Game/GameScene.ts index 1c49e774..e6e93b57 100644 --- a/front/src/Phaser/Game/GameScene.ts +++ b/front/src/Phaser/Game/GameScene.ts @@ -161,6 +161,7 @@ export class GameScene extends DirtyScene { private createPromiseResolve!: (value?: void | PromiseLike) => void; private iframeSubscriptionList!: Array; private peerStoreUnsubscribe!: () => void; + private biggestAvailableAreaStoreUnsubscribe!: () => void; MapUrlFile: string; RoomId: string; instance: string; @@ -501,7 +502,7 @@ export class GameScene extends DirtyScene { this.reposition(); // From now, this game scene will be notified of reposition events - biggestAvailableAreaStore.subscribe((box) => this.updateCameraOffset(box)); + this.biggestAvailableAreaStoreUnsubscribe = biggestAvailableAreaStore.subscribe((box) => this.updateCameraOffset(box)); this.triggerOnMapLayerPropertyChange(); this.listenToIframeEvents(); @@ -1025,6 +1026,7 @@ ${escapedMessage} this.pinchManager?.destroy(); this.emoteManager.destroy(); this.peerStoreUnsubscribe(); + this.biggestAvailableAreaStoreUnsubscribe(); mediaManager.hideGameOverlay();