Browse Source

Fix bug when `destroy()` is called twice (fixes #468).

pull/482/head
Matthew Petroff 7 years ago
parent
commit
508a21044f
1 changed files with 2 additions and 2 deletions
  1. +2
    -2
      src/js/libpannellum.js

+ 2
- 2
src/js/libpannellum.js View File

@@ -422,10 +422,10 @@ function Renderer(container) {
*/
this.destroy = function() {
if (container !== undefined) {
if (canvas !== undefined) {
if (canvas !== undefined && container.contains(canvas)) {
container.removeChild(canvas);
}
if (world !== undefined) {
if (world !== undefined && container.contains(world)) {
container.removeChild(world);
}
}


Loading…
Cancel
Save