[Pkg-owncloud-commits] [owncloud] 228/273: Fixed event source fallback after close

David Prévot taffit at moszumanska.debian.org
Fri Jul 4 03:13:20 UTC 2014


This is an automated email from the git hooks/post-receive script.

taffit pushed a commit to branch master
in repository owncloud.

commit 012abbad44f91e7318c15d973f97474ba3bfeff5
Author: Vincent Petry <pvince81 at owncloud.com>
Date:   Wed Jul 2 21:31:11 2014 +0200

    Fixed event source fallback after close
---
 core/js/eventsource.js | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/core/js/eventsource.js b/core/js/eventsource.js
index ce2a13d..7bb23dc 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();
 		}

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-owncloud/owncloud.git



More information about the Pkg-owncloud-commits mailing list