Skip to content
This repository has been archived by the owner on Nov 25, 2020. It is now read-only.

Commit

Permalink
better memory management on destroy
Browse files Browse the repository at this point in the history
  • Loading branch information
uzikilon committed Jun 1, 2015
1 parent 6b464e7 commit 725e8d2
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ However, in many cases it is sufficient to run a standard http request every few
Backbone poller helps with these cases:

- Allows you to poll without extending your base backbone models or collections
- Guarantees one poller per model/collection instance
- Aborts running connections on stop/destroy
- Prevents from running conflicting requests
- Is 100% compliant with any Backbone model or collection.

The [annotated source code](<http://uzikilon.github.com/backbone-poller/>) is available online.
Expand Down
4 changes: 1 addition & 3 deletions backbone.poller.js
Original file line number Diff line number Diff line change
Expand Up @@ -158,9 +158,7 @@ Backbone Poller may be freely distributed under the MIT license.
this.stop();
this.stopListening();
this.off();
pollers = _.filter(pollers, function (poller) {
return poller !== this;
}, this);
pollers.splice(_.indexOf(pollers, this), 1);
}
});

Expand Down
2 changes: 1 addition & 1 deletion backbone.poller.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 725e8d2

Please sign in to comment.