Skip to content

Commit

Permalink
Merge pull request #197 from Smithsonian/dev-bugfix
Browse files Browse the repository at this point in the history
Bug fix for dispose call with multiple scenes on page
  • Loading branch information
gjcope authored Mar 1, 2023
2 parents fb2c1b5 + 8d5a987 commit edb8bed
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion source/client/components/CVDirectionalLight.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ export default class CVDirectionalLight extends CDirectionalLight implements ICV
}

dispose(): void {
if(this.ins.shadowEnabled.value) {
if(this.ins.shadowEnabled.value && this.light.shadow.map) {
this.light.shadow.map.dispose();
}

Expand Down
2 changes: 1 addition & 1 deletion source/client/components/CVPointLight.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ export default class CVPointLight extends CPointLight implements ICVLight
}

dispose(): void {
if(this.ins.shadowEnabled.value) {
if(this.ins.shadowEnabled.value && this.light.shadow.map) {
this.light.shadow.map.dispose();
}

Expand Down
2 changes: 1 addition & 1 deletion source/client/components/CVSpotLight.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ export default class CVSpotLight extends CSpotLight implements ICVLight
}

dispose(): void {
if(this.ins.shadowEnabled.value) {
if(this.ins.shadowEnabled.value && this.light.shadow.map) {
this.light.shadow.map.dispose();
}

Expand Down

0 comments on commit edb8bed

Please sign in to comment.