--- a/toolkit/components/passwordmgr/src/storage-mozStorage.js
+++ b/toolkit/components/passwordmgr/src/storage-mozStorage.js
@@ -949,17 +949,22 @@ LoginManagerStorage_mozStorage.prototype
* Creates a statement, wraps it, and then does parameter replacement
* Returns the wrapped statement for execution. Will use memoization
* so that statements can be reused.
*/
_dbCreateStatement : function (query, params) {
// 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)
for (let i in params)
this._dbStmts[query].params[i] = params[i];
return this._dbStmts[query];
},
@@ -1072,17 +1077,17 @@ LoginManagerStorage_mozStorage.prototype
// Create backup file
if (backup) {
let backupFile = this._signonsFile.leafName + ".corrupt";
this._storageService.backupDatabaseFile(this._signonsFile, backupFile);
}
// 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
try { this._dbConnection.close() } catch(e) {}
this._signonsFile.remove(false);
}
}; // end of nsLoginManagerStorage_mozStorage implementation