Skip to content

Commit c1703ba

Browse files
committed
fix(endscreen): using flagForDestructionOnReinit
1 parent f8a22c8 commit c1703ba

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

engine/modules/endscreen/src/main/resources/view/endscreen-module/EndScreenModule.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import {WIDTH, HEIGHT} from '../core/constants.js'
22
import {lerp, unlerp} from '../core/utils.js'
33
import {ErrorLog} from '../core/ErrorLog.js'
44
import {MissingImageError} from './errors/MissingImageError.js'
5-
5+
import {flagForDestructionOnReinit} from '../core/rendering.js'
66
/* global PIXI */
77

88
export class EndScreenModule {
@@ -49,7 +49,6 @@ export class EndScreenModule {
4949
}
5050

5151
reinitScene (container, canvasData) {
52-
this.toDestroy = []
5352
this.container = container
5453
this.endLayer = this.createEndScene(this)
5554
if (this.atEnd) {
@@ -137,8 +136,8 @@ export class EndScreenModule {
137136
fill: color
138137
})
139138
textEl.lineHeight = Math.round(size / 1.2)
140-
this.toDestroy.push(textEl)
141139
}
140+
flagForDestructionOnReinit(textEl)
142141
if (align === 'right') {
143142
textEl.anchor.x = 1
144143
} else if (align === 'center') {

0 commit comments

Comments
 (0)