Преглед на файлове

Another DOM leak fix.

pull/72/head
Matthew Petroff преди 9 години
родител
ревизия
e1947f601a
променени са 2 файла, в които са добавени 6 реда и са изтрити 5 реда
  1. +4
    -3
      src/js/libpannellum.js
  2. +2
    -2
      src/js/pannellum.js

+ 4
- 3
src/js/libpannellum.js Целия файл

@@ -148,7 +148,7 @@ function Renderer(container, image, imageType, video) {
if (loaded == 6) {
fallbackImgSize = this.width;
container.appendChild(world);
renderer.image = null;
delete renderer.image;
callback();
}
};
@@ -288,13 +288,13 @@ function Renderer(container, image, imageType, video) {
gl.texImage2D(gl.TEXTURE_CUBE_MAP_NEGATIVE_Y, 0, gl.RGB, gl.RGB, gl.UNSIGNED_BYTE, this.image[5]);
gl.texImage2D(gl.TEXTURE_CUBE_MAP_POSITIVE_Z, 0, gl.RGB, gl.RGB, gl.UNSIGNED_BYTE, this.image[0]);
gl.texImage2D(gl.TEXTURE_CUBE_MAP_NEGATIVE_Z, 0, gl.RGB, gl.RGB, gl.UNSIGNED_BYTE, this.image[2]);
this.image = undefined;
delete this.image;
} else {
// Upload image to the texture
gl.texImage2D(glBindType, 0, gl.RGB, gl.RGB, gl.UNSIGNED_BYTE, this.image);
if (this.video !== true) {
// Allow memory to be freed
this.image = undefined;
delete this.image;
}
}

@@ -754,6 +754,7 @@ function Renderer(container, image, imageType, video) {
node.image.onload = function() {
self.processLoadedTexture(node.image, node.texture);
node.textureLoaded = true;
delete node.image;
};
node.image.src = node.path + '.' + this.image.extension;
}


+ 2
- 2
src/js/pannellum.js Целия файл

@@ -1054,11 +1054,11 @@ function destroyHotSpots() {
current = current.parentNode;
}
renderContainer.removeChild(current);
config.hotSpots[i].div = null;
delete config.hotSpots[i].div;
}
}
hotspotsCreated = false;
config.hotSpots = undefined;
delete config.hotSpots;
}

function renderHotSpots() {


Зареждане…
Отказ
Запис