[deploy] properly destroy world view

This commit is contained in:
Vitaly 2025-07-14 06:40:00 +03:00
commit 6a8d15b638
3 changed files with 6 additions and 1 deletions

View file

@ -34,6 +34,10 @@ export type WorldDataEmitterEvents = {
export class WorldDataEmitterWorker extends (EventEmitter as new () => TypedEmitter<WorldDataEmitterEvents>) {
static readonly restorerName = 'WorldDataEmitterWorker'
destroy () {
this.removeAllListeners()
}
}
export class WorldDataEmitter extends (EventEmitter as new () => TypedEmitter<WorldDataEmitterEvents>) {

View file

@ -569,7 +569,7 @@ export abstract class WorldRendererCommon<WorkerSend = any, WorkerReceive = any>
getMesherConfig (): MesherConfig {
return {
version: this.version,
enableLighting: this.worldRendererConfig.enableLighting && !this.playerState.lightingDisabled,
enableLighting: this.worldRendererConfig.enableLighting && !this.playerStateReactive.lightingDisabled,
skyLight: this.skyLight,
smoothLighting: this.worldRendererConfig.smoothLighting,
outputFormat: this.outputFormat,

View file

@ -261,6 +261,7 @@ export class AppViewer {
if (cleanState) {
this.currentState = undefined
this.currentDisplay = null
this.worldView?.destroy()
this.worldView = undefined
}
if (this.backend) {