Bug 1109589 - Disconnect accounts before removing them. r=clokep
authoraleth <aleth@instantbird.org>
Sun, 19 Apr 2015 00:26:51 +0200
changeset 17803 6d58afb3c8de0460f19b325a4c568753ef2bb8c1
parent 17802 dbef5e81cd11a369fe61fa0c40b3de27702d1a85
child 17804 8d15ac32e757c144082c08f5035b60f6338da737
push id10951
push useraleth@instantbird.org
push dateSun, 19 Apr 2015 13:18:09 +0000
treeherdercomm-central@6d58afb3c8de [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersclokep
bugs1109589
Bug 1109589 - Disconnect accounts before removing them. r=clokep
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.