Bug 1109589 - Disconnect accounts before removing them. r=clokep, a=rkent
authoraleth <aleth@instantbird.org>
Sun, 19 Apr 2015 00:26:51 +0200
changeset 22005 4231e422562adc7bfee84970594c9b15635af3c3
parent 22002 80ec65353d8f03d7ad85c4d17b5e22c2ef6313d3
child 22006 53b37cdf7e7418848c661623b440cbe7ea51d040
push id1340
push userkent@caspia.com
push dateTue, 21 Apr 2015 23:35:40 +0000
treeherdercomm-beta@ec4c11836db9 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersclokep, rkent
bugs1109589
Bug 1109589 - Disconnect accounts before removing them. r=clokep, a=rkent
chat/components/src/imAccounts.js
--- a/chat/components/src/imAccounts.js
+++ b/chat/components/src/imAccounts.js
@@ -625,16 +625,18 @@ imAccount.prototype = {
     login.init(passwordURI, null, passwordURI, this.normalizedName, "", "", "");
     let logins = Services.logins.findLogins({}, passwordURI, null, passwordURI);
     for each (let l in logins) {
       if (login.matches(l, true)) {
         Services.logins.removeLogin(l);
         break;
       }
     }
+    if (this.connected || this.connecting)
+      this.disconnect();
     if (this.prplAccount)
       this.prplAccount.remove();
     this.unInit();
     Services.contacts.forgetAccount(this.numericId);
     this.prefBranch.deleteBranch("");
   },
   unInit: function() {
     // remove any pending reconnection timer.