(Merge for "Backed out changeset: c8eb8a8f42d9")

This commit is contained in:
Serge Gautherie 2008-12-04 19:32:03 +01:00
Родитель 21776d88cd f4737a770c
Коммит 66ef6b846d
1 изменённых файлов: 7 добавлений и 2 удалений

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

@ -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