Skip to content

Commit

Permalink
fix: components.dispose failed when ui disabled (#267)
Browse files Browse the repository at this point in the history
  • Loading branch information
HoyosJuan authored Jan 16, 2024
1 parent b836e28 commit 83fc9ec
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
5 changes: 3 additions & 2 deletions resources/openbim-components.js
Original file line number Diff line number Diff line change
Expand Up @@ -11739,10 +11739,11 @@ class Components {
*
*/
async dispose() {
var _a;
const disposer = this.tools.get(Disposer);
this.enabled = false;
await this.tools.dispose();
await this.ui.dispose();
await ((_a = this.ui) === null || _a === void 0 ? void 0 : _a.dispose());
this.onInitialized.reset();
this._clock.stop();
for (const mesh of this.meshes) {
Expand Down Expand Up @@ -11775,7 +11776,7 @@ class Components {
THREE$1.Mesh.prototype.raycast = acceleratedRaycast;
}
}
Components.release = "1.2.0";
Components.release = "1.3.0";

const _raycaster = new Raycaster();

Expand Down
4 changes: 2 additions & 2 deletions src/core/Components/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ export class Components implements Disposable {

enabled = false;

static readonly release = "1.2.0";
static readonly release = "1.3.0";

/** Whether UI components should be created. */
uiEnabled = true;
Expand Down Expand Up @@ -175,7 +175,7 @@ export class Components implements Disposable {
const disposer = this.tools.get(Disposer);
this.enabled = false;
await this.tools.dispose();
await this.ui.dispose();
await this.ui?.dispose();
this.onInitialized.reset();
this._clock.stop();
for (const mesh of this.meshes) {
Expand Down

0 comments on commit 83fc9ec

Please sign in to comment.