Skip to content

Instantly share code, notes, and snippets.

View DrewMartin's full-sized avatar

Drew Martin DrewMartin

View GitHub Profile
@DrewMartin
DrewMartin / gist:2ec774e088fdb26a425b
Created March 8, 2015 19:06
jQuery memory leaking
(function() {
var __bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; };
window.Leak = (function() {
function Leak(node, data) {
this.data = data;
this.onNodeChanged = __bind(this.onNodeChanged, this);
$(node).on("change", this.onNodeChanged);
}