Index: dojo-release-1.3.2-src/dojox/xmpp/xmppSession.js =================================================================== --- dojo-release-1.3.2-src.orig/dojox/xmpp/xmppSession.js 2010-05-07 12:25:42.000000000 +0530 +++ dojo-release-1.3.2-src/dojox/xmpp/xmppSession.js 2010-05-07 12:26:42.000000000 +0530 @@ -57,9 +57,10 @@ } this.session = new dojox.xmpp.TransportSession(props); - dojo.connect(this.session, "onReady", this, "onTransportReady"); - dojo.connect(this.session, "onTerminate", this, "onTransportTerminate"); - dojo.connect(this.session, "onProcessProtocolResponse", this, "processProtocolResponse"); + this._connects = []; + this._connects.push(dojo.connect(this.session, "onReady", this, "onTransportReady")); + this._connects.push(dojo.connect(this.session, "onTerminate", this, "onTransportTerminate")); + this._connects.push(dojo.connect(this.session, "onProcessProtocolResponse", this, "processProtocolResponse")); }; @@ -894,6 +895,8 @@ onTransportTerminate: function(newState, oldState, message){ this.setState(dojox.xmpp.xmpp.TERMINATE, message); + dojo.forEach(this._connects, dojo.disconnect); + this._connects = []; }, onConnected: function(){