Skip to content

Commit

Permalink
(Merge bug 455265 backout)
Browse files Browse the repository at this point in the history
  • Loading branch information
Serge Gautherie committed Sep 20, 2008
2 parents ff2fb34 + 9c93c67 commit 950e676
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions toolkit/components/passwordmgr/src/storage-mozStorage.js
Original file line number Diff line number Diff line change
Expand Up @@ -947,7 +947,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)
Expand Down Expand Up @@ -1070,7 +1075,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
Expand Down

0 comments on commit 950e676

Please sign in to comment.