Bug 1109589 - Disconnect accounts before removing them. r=clokep, a=rkent
authoraleth <aleth@instantbird.org>
Sun, 19 Apr 2015 00:26:51 +0200
changeset 19902 e4457a5dd5f718fbfc369607d8e624cbba52aa8e
parent 19901 85bcf1bc0b53c167f46d21e810ecf9863ac056e9
child 19903 7e07f36a44776ae521feb1ca66a8726bae05059b
push id1410
push userkent@caspia.com
push dateTue, 21 Apr 2015 23:06:52 +0000
treeherdercomm-aurora@7e07f36a4477 [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.