summaryrefslogtreecommitdiffstats
path: root/core/js/eventsource.js
diff options
context:
space:
mode:
Diffstat (limited to 'core/js/eventsource.js')
-rw-r--r--core/js/eventsource.js6
1 files changed, 6 insertions, 0 deletions
diff --git a/core/js/eventsource.js b/core/js/eventsource.js
index ce2a13d4676..7bb23dc44f7 100644
--- a/core/js/eventsource.js
+++ b/core/js/eventsource.js
@@ -35,6 +35,7 @@
*/
OC.EventSource=function(src,data){
var dataStr='';
+ this.closed = false;
this.typelessListeners=[];
this.listeners={};
if(data){
@@ -88,6 +89,10 @@ OC.EventSource.prototype={
listeners:{},//only for fallback
useFallBack:false,
fallBackCallBack:function(type,data){
+ // ignore messages that might appear after closing
+ if (this.closed) {
+ return;
+ }
if(type){
if (typeof this.listeners['done'] != 'undefined') {
for(var i=0;i<this.listeners[type].length;i++){
@@ -125,6 +130,7 @@ OC.EventSource.prototype={
}
},
close:function(){
+ this.closed = true;
if (typeof this.source !='undefined') {
this.source.close();
}