git.asbjorn.biz
/
jquery.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
db10da3
)
Landed a fix for timeouts not being aborted properly. Fixes jQuery bug #3874.
author
John Resig
<jeresig@gmail.com>
Wed, 21 Jan 2009 21:46:53 +0000
(21:46 +0000)
committer
John Resig
<jeresig@gmail.com>
Wed, 21 Jan 2009 21:46:53 +0000
(21:46 +0000)
src/ajax.js
patch
|
blob
|
history
diff --git
a/src/ajax.js
b/src/ajax.js
index
9e30eef
..
8262bc7
100644
(file)
--- a/
src/ajax.js
+++ b/
src/ajax.js
@@
-380,6
+380,9
@@
jQuery.extend({
// Fire the complete handlers
complete();
// Fire the complete handlers
complete();
+ if ( isTimeout )
+ xhr.abort();
+
// Stop memory leaks
if ( s.async )
xhr = null;
// 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 ( 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);
}
}, s.timeout);
}