perf(falukant): deploy prebuilt models and release WebGL contexts
All checks were successful
Deploy to production / deploy (push) Successful in 2m19s
All checks were successful
Deploy to production / deploy (push) Successful in 2m19s
This commit is contained in:
@@ -332,7 +332,7 @@ export default {
|
||||
// Renderer erstellen
|
||||
this.renderer = markRaw(new runtime.WebGLRenderer({ antialias: true, alpha: true }));
|
||||
this.renderer.setSize(container.clientWidth, container.clientHeight);
|
||||
this.renderer.setPixelRatio(window.devicePixelRatio);
|
||||
this.renderer.setPixelRatio(Math.min(window.devicePixelRatio || 1, 2));
|
||||
container.appendChild(this.renderer.domElement);
|
||||
|
||||
// Verbesserte Beleuchtung für kräftigere Farben
|
||||
@@ -687,7 +687,12 @@ export default {
|
||||
if (container && this.renderer.domElement) {
|
||||
container.removeChild(this.renderer.domElement);
|
||||
}
|
||||
// dispose() alone leaves the browser context alive until garbage
|
||||
// collection. Route changes or long character lists can otherwise
|
||||
// exceed Chromium's context limit and crash the tab.
|
||||
this.renderer.forceContextLoss?.();
|
||||
this.renderer.dispose();
|
||||
this.renderer = null;
|
||||
}
|
||||
|
||||
if (this.scene) {
|
||||
|
||||
@@ -124,9 +124,15 @@ export default {
|
||||
this.removeModel();
|
||||
if (this.renderer) {
|
||||
this.$refs.container?.removeChild(this.renderer.domElement);
|
||||
// Release immediately instead of waiting for garbage collection.
|
||||
// Several house previews otherwise accumulate WebGL contexts.
|
||||
this.renderer.forceContextLoss?.();
|
||||
this.renderer.dispose();
|
||||
this.renderer = null;
|
||||
}
|
||||
this.scene?.clear();
|
||||
this.scene = null;
|
||||
this.camera = null;
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user