Permalink
Browse files

Using close() on the stream when host API is used

  • Loading branch information...
1 parent 9e0bf31 commit cf2cd1caca6ea3ad9c1e896fa44e60f129a37239 @lightpriest lightpriest committed May 29, 2012
Showing with 10 additions and 0 deletions.
  1. +10 −0 jquery.eventsource.js
View
@@ -41,6 +41,12 @@
var tmp = {};
if ( !label || label === "*" ) {
+ for ( var prop in stream.cache ) {
+ if ( stream.cache[ prop ].isHostApi ) {
+ stream.cache[ prop ].stream.close();
+ }
+ }
+
stream.cache = {};
return stream.cache;
@@ -49,6 +55,10 @@
for ( var prop in stream.cache ) {
if ( label !== prop ) {
tmp[ prop ] = stream.cache[ prop ];
+ } else {
+ if ( stream.cache[ prop ].isHostApi ) {
+ stream.cache[ prop ].stream.close();
+ }
}
}

0 comments on commit cf2cd1c

Please sign in to comment.