Backed out changeset fa8fbd81159d

Bug 452899 - Don't explicitly create the statement wrapper - storage does it for us; r=(dolske + sdwilsh)
to try to fix leak
This commit is contained in:
Serge Gautherie 2008-09-20 19:41:50 +02:00
Родитель dd8f34b6a6
Коммит 2f7ae7471f
1 изменённых файлов: 7 добавлений и 2 удалений

Просмотреть файл

@ -947,7 +947,12 @@ LoginManagerStorage_mozStorage.prototype = {
// Memoize the statements // Memoize the statements
if (!this._dbStmts[query]) { if (!this._dbStmts[query]) {
this.log("Creating new statement for query: " + 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 // Replace parameters, must be done 1 at a time
if (params) if (params)
@ -1070,7 +1075,7 @@ LoginManagerStorage_mozStorage.prototype = {
// Finalize all statements to free memory, avoid errors later // Finalize all statements to free memory, avoid errors later
for (let i = 0; i < this._dbStmts.length; i++) for (let i = 0; i < this._dbStmts.length; i++)
this._dbStmts[i].finalize(); this._dbStmts[i].statement.finalize();
this._dbStmts = []; this._dbStmts = [];
// Close the connection, ignore 'already closed' error // Close the connection, ignore 'already closed' error