Skip to content

Commit 0920f77

Browse files
Merge pull request #1424 from solaris-games/dev
Fix map event listeners not being cleared properly
2 parents d9990ed + 5359b1b commit 0920f77

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

client/src/game/container.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,11 @@ export class GameContainer {
117117
destroy () {
118118
console.warn('Destroying game container')
119119

120+
if (this.map) {
121+
this.map.destroy();
122+
this.map = undefined;
123+
}
124+
120125
if (this.viewport) {
121126
this.viewport.destroy()
122127
this.viewport = undefined

client/src/views/game/components/GameContainer.vue

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,8 @@ onMounted(() => {
139139
});
140140
141141
onBeforeUnmount(() => {
142+
clearInterval(polling.value);
143+
142144
gameContainer.destroy();
143145
144146
eventBus.off(MapEventBusEventNames.MapOnStarClicked, onStarClickedHandler);

0 commit comments

Comments
 (0)