Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Fixed memory leak in overlay library #976

Closed
wants to merge 1 commit into from

2 participants

@spmason

Overlays are added to the instances array, and never removed.  This means that DOM elements would leak over time

Added necessary cleanup to the overlays close method

@spmason spmason Fixed memory leak in overlay library
Overlays are added to the instances array, and never removed.  This means that DOM elements would leak over time

Added necessary cleanup to the overlays `close` method
be6af4a
@alibby251
Owner

Hi spmason,

Thanks for this - could you please rebase your patch onto the dev branch, so I can commit it?

@alibby251 alibby251 closed this
@spmason spmason referenced this pull request from a commit
@spmason spmason Fixed memory leak in overlay library
Overlays are added to the instances array, and never removed.  This means that DOM elements would leak over time

Added necessary cleanup to the overlays close method

Previously opened as #976
3d03130
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Mar 27, 2013
  1. @spmason

    Fixed memory leak in overlay library

    spmason authored
    Overlays are added to the instances array, and never removed.  This means that DOM elements would leak over time
    
    Added necessary cleanup to the overlays `close` method
This page is out of date. Refresh to see the latest.
Showing with 5 additions and 0 deletions.
  1. +5 −0 src/overlay/overlay.js
View
5 src/overlay/overlay.js
@@ -186,6 +186,11 @@
},
close: function(e) {
+ var instanceIndex = instances.indexOf(this);
+
+ if(instanceIndex > -1){
+ instances.splice(instanceIndex, 1);
+ }
if (!self.isOpened()) { return self; }
Something went wrong with that request. Please try again.