Skip to content

Loading…

Fix in dispose method #397

Merged
merged 3 commits into from

2 participants

@mloginov

No description provided.

@mloginov mloginov closed this
@mloginov mloginov reopened this
mloginov added some commits
@mloginov mloginov removed image load handlers on dispose
to prevent exception if gallery disposes and image not loaded yet
0fb4575
@mloginov mloginov skip if gallery already disposed
to prevent this.settings.target null pointer exception if gallery already disposed
801360a
@billinghamj billinghamj merged commit bbdf168 into dimsemenov:master
@thorstein5 thorstein5 added a commit to thorstein5/PhotoSwipe that referenced this pull request
@thorstein5 thorstein5 Fixes build errors and removes thumbs.db files
Fixes errors reported by JSLint during build on Windows introduced in
pull request #351 and #397, and removes unnecessary Windows specific
Thumbs.db files introduced in pull request #276.
ffdf883
@thorstein5 thorstein5 added a commit to thorstein5/PhotoSwipe that referenced this pull request
@thorstein5 thorstein5 Fixes build errors and removes thumbs.db files
Fixes 4 "errors" introduced in pull request #351 and #397 reported by
JSLint  - errors which causes the build script to fail, and cleans up
unnecessary Windows specific Thumbs.db files first introduced in pull
request #345.
dddba62
@thorstein5 thorstein5 added a commit to thorstein5/PhotoSwipe that referenced this pull request
@thorstein5 thorstein5 Fixes build errors and removes thumbs.db files
Fixes 4 "errors" introduced in pull request #351 and #397 reported by
JSLint  - errors which causes the build script to fail, and cleans up
unnecessary Windows specific Thumbs.db files first introduced in pull
request #345.
2a112d8
@thorstein5 thorstein5 added a commit to thorstein5/PhotoSwipe that referenced this pull request
@thorstein5 thorstein5 Fixes build errors and removes thumbs.db files
Fixes 4 "errors" introduced in pull request #351 and #397 reported by
JSLint  - errors which causes the build script to fail, and cleans up
unnecessary Windows specific Thumbs.db files first introduced in pull
request #345.
d0d276f
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Sep 24, 2012
  1. @mloginov
Commits on Sep 27, 2012
  1. @mloginov

    removed image load handlers on dispose

    mloginov committed
    to prevent exception if gallery disposes and image not loaded yet
  2. @mloginov

    skip if gallery already disposed

    mloginov committed
    to prevent this.settings.target null pointer exception if gallery already disposed
Showing with 7 additions and 2 deletions.
  1. +3 −0 src/image.class.js
  2. +4 −2 src/photoswipe.class.js
View
3 src/image.class.js
@@ -32,6 +32,9 @@
var prop, i;
this.shrinkImage();
+
+ if (!Util.isNothing(this.imageEl))
+ this.imageEl.onload = null;
for (prop in this) {
if (Util.objectHasProperty(this, prop)) {
View
6 src/photoswipe.class.js
@@ -90,6 +90,8 @@
this.carousel.dispose();
}
+ this.destroyZoomPanRotate();
+
if (!Util.isNothing(this.uiLayer)){
this.uiLayer.dispose();
}
@@ -98,8 +100,6 @@
this.toolbar.dispose();
}
- this.destroyZoomPanRotate();
-
if (!Util.isNothing(this.cache)){
this.cache.dispose();
}
@@ -814,6 +814,8 @@
onDocumentOverlayFadeIn: function(e){
window.setTimeout(function(){
+ if (Util.isNothing(this.settings))
+ return;
var el = (this.settings.target === window) ? window.document.body : this.settings.target;
Something went wrong with that request. Please try again.