This question depends my previous question: Browser crashes after 10-15 mins On that question I got answer saying my code is doing memory leak. So I’m trying to find the point where memory leak is going on.
Will this script will result in memory leak?
var j = function (i, q, r, a) {
return function (s) {
var p = r.annotation;
if (p.hasOwnProperty(i)) {
p[i](p, r, a.dygraph_, s)
} else {
if (a.dygraph_.attr_(q)) {
a.dygraph_.attr_(q)(p, r, a.dygraph_, s)
}
}
}
};
If yes then is there any solution that I can do to prevent memory leak?
It’s not apparent if there are memory leaks, but if this were my code, I would change it like so (not counting the bad variable naming):