Skip to content

Instantly share code, notes, and snippets.

@meleyal
Last active December 16, 2015 02:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save meleyal/5364759 to your computer and use it in GitHub Desktop.
Save meleyal/5364759 to your computer and use it in GitHub Desktop.
Test Backbone views for memory leaks
window.installTest = ->
views = []
viewClass = app.NotificationsView
options = { collection: new Backbone.Collection }
views.push(new viewClass(options)) for i in [0...500]
view.remove() for view in views
views = []
console.log "#{viewClass.name} installed and removed x #{i}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment