From f4737a770cbd763e9d2ee0bb5f3a8f91ebece43d Mon Sep 17 00:00:00 2001 From: Serge Gautherie Date: Thu, 4 Dec 2008 19:30:21 +0100 Subject: [PATCH] Backed out changeset: c8eb8a8f42d9 for Bug 452899 - Don't explicitly create the statement wrapper - storage does it for us; (retry, after bug 457743 was fixed); r=(dolske + sdwilsh) which is causing Leaks (again). --- toolkit/components/passwordmgr/src/storage-mozStorage.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/toolkit/components/passwordmgr/src/storage-mozStorage.js b/toolkit/components/passwordmgr/src/storage-mozStorage.js index 66c1c36ed49..cd5b562ab71 100644 --- a/toolkit/components/passwordmgr/src/storage-mozStorage.js +++ b/toolkit/components/passwordmgr/src/storage-mozStorage.js @@ -954,7 +954,12 @@ LoginManagerStorage_mozStorage.prototype = { // Memoize the statements if (!this._dbStmts[query]) { this.log("Creating new statement for query: " + query); - this._dbStmts[query] = this._dbConnection.createStatement(query); + let stmt = this._dbConnection.createStatement(query); + + let wrappedStmt = Cc["@mozilla.org/storage/statement-wrapper;1"]. + createInstance(Ci.mozIStorageStatementWrapper); + wrappedStmt.initialize(stmt); + this._dbStmts[query] = wrappedStmt; } // Replace parameters, must be done 1 at a time if (params) @@ -1077,7 +1082,7 @@ LoginManagerStorage_mozStorage.prototype = { // Finalize all statements to free memory, avoid errors later for (let i = 0; i < this._dbStmts.length; i++) - this._dbStmts[i].finalize(); + this._dbStmts[i].statement.finalize(); this._dbStmts = []; // Close the connection, ignore 'already closed' error