Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Landed a fix for timeouts not being aborted properly. Fixes jQuery bu…

…g #3874.
  • Loading branch information...
commit 00b70c75278896495365e25f0327af4a1b61acce 1 parent db10da3
@jeresig jeresig authored
Showing with 5 additions and 8 deletions.
  1. +5 −8 src/ajax.js
View
13 src/ajax.js
@@ -380,6 +380,9 @@ jQuery.extend({
// Fire the complete handlers
complete();
+ if ( isTimeout )
+ xhr.abort();
+
// Stop memory leaks
if ( s.async )
xhr = null;
@@ -394,14 +397,8 @@ jQuery.extend({
if ( s.timeout > 0 )
setTimeout(function(){
// Check to see if the request is still happening
- if ( xhr ) {
- if( !requestDone )
- onreadystatechange( "timeout" );
-
- // Cancel the request
- if ( xhr )
- xhr.abort();
- }
+ if ( xhr && !requestDone )
+ onreadystatechange( "timeout" );
}, s.timeout);
}
Please sign in to comment.
Something went wrong with that request. Please try again.