Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Request.JSONP clear() is never called for timedout request -> memory leak #1135

Open
kguelzau opened this Issue Jun 27, 2012 · 0 comments

Comments

Projects
None yet
1 participant

kguelzau commented Jun 27, 2012 edited by arian

Here is an issue with Request.JSONP.

When I use a timeout, clear() is never called and the script element stays on the page forever!

Demo: http://jsfiddle.net/kguelzau/pZG66/

The timeout method should be modified to call clear() directly:

timeout: function(){
  if (this.running){
    var script = this.script; // local copy due to possible race condition on reused request
    this.running = false;
    this.fireEvent('timeout', [script.get('src'), script]).fireEvent('failure').clear();
  }
  return this;
}

Loosely related to #1052

--- Want to back this issue? **[Post a bounty on it!](https://www.bountysource.com/issues/359785-request-jsonp-clear-is-never-called-for-timedout-request-memory-leak?utm_campaign=plugin&utm_content=tracker%2F22069&utm_medium=issues&utm_source=github)** We accept bounties via [Bountysource](https://www.bountysource.com/?utm_campaign=plugin&utm_content=tracker%2F22069&utm_medium=issues&utm_source=github).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment