Bug 748852 - Contacts API: Fix leak, error handling. r=fabrice

This commit is contained in:
Gregor Wagner 2012-04-25 18:31:48 -07:00
parent 423a1ad7a5
commit 46b2d1ab44
3 changed files with 5 additions and 23 deletions

View File

@ -334,8 +334,6 @@ ContactManager.prototype = {
"Contact:Save:Return:OK", "Contact:Save:Return:KO",
"Contact:Remove:Return:OK", "Contact:Remove:Return:KO"]);
Services.obs.addObserver(this, "inner-window-destroyed", false);
let principal = aWindow.document.nodePrincipal;
let secMan = Cc["@mozilla.org/scriptsecuritymanager;1"].getService(Ci.nsIScriptSecurityManager);

View File

@ -153,27 +153,10 @@ ContactDB.prototype = {
};
txn.onabort = function (event) {
debug("Caught error on transaction" + event.target.error.name);
switch(event.target.error.name) {
case "AbortError":
case "ConstraintError":
case "DataError":
case "SyntaxError":
case "InvalidStateError":
case "NotFoundError":
case "QuotaExceededError":
case "ReadOnlyError":
case "TimeoutError":
case "TransactionInactiveError":
case "VersionError":
case "UnknownError":
debug("Caught error on transaction");
// FIXXMEE: this will work in the future. Bug 748630
// failureCb(event.target.error.name);
failureCb("UnknownError");
break;
default:
debug("Unknown error", event.target.error.name);
failureCb("UnknownError");
break;
}
};
callback(txn, store);
}, failureCb);

View File

@ -61,6 +61,7 @@ let DOMContactManager = {
this._messages = null;
if (this._db)
this._db.close();
this._db = null;
},
receiveMessage: function(aMessage) {