mirror of
https://github.com/openglobus/openglobus.git
synced 2025-12-08 19:25:27 +00:00
terminate workers on destroy
This commit is contained in:
parent
a12f500a92
commit
56d2fc6657
@ -1433,6 +1433,8 @@ class Renderer {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public destroy() {
|
public destroy() {
|
||||||
|
this.labelWorker.destroy();
|
||||||
|
|
||||||
for (let i in this.controls) {
|
for (let i in this.controls) {
|
||||||
this.controls[i].remove();
|
this.controls[i].remove();
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1988,6 +1988,18 @@ export class Planet extends RenderNode {
|
|||||||
this.quadTreeStrategy.clearRenderedNodes();
|
this.quadTreeStrategy.clearRenderedNodes();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Destroy planet.
|
||||||
|
* @public
|
||||||
|
*/
|
||||||
|
public override destroy() {
|
||||||
|
this._terrainWorker.destroy();
|
||||||
|
this._plainSegmentWorker.destroy();
|
||||||
|
this.renderer?.destroy()
|
||||||
|
this.onremove();
|
||||||
|
super.destroy();
|
||||||
|
}
|
||||||
|
|
||||||
// function checkTerrainCollision(entity) {
|
// function checkTerrainCollision(entity) {
|
||||||
// let _tempTerrPoint = new Vec3();
|
// let _tempTerrPoint = new Vec3();
|
||||||
// let nodes = globus.planet._renderedNodes;
|
// let nodes = globus.planet._renderedNodes;
|
||||||
|
|||||||
@ -62,10 +62,8 @@ export class BaseWorker<T> {
|
|||||||
w.onmessage = null;
|
w.onmessage = null;
|
||||||
w.terminate();
|
w.terminate();
|
||||||
}
|
}
|
||||||
//@ts-ignore
|
this._pendingQueue = [];
|
||||||
this._pendingQueue = null;
|
this._workerQueue = [];
|
||||||
//@ts-ignore
|
|
||||||
this._workerQueue = null;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public get pendingQueue(): T[] {
|
public get pendingQueue(): T[] {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user