mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-08 19:04:45 +00:00
Bug 479729 - Unable to shutdown using async statements.
This changeset finalizes statements before we try to rollback a transaction with the async storage API. This problem only came up when you canceled a statement. r=asuth
This commit is contained in:
parent
7e1b0db13a
commit
924eedb602
@ -495,6 +495,14 @@ private:
|
||||
NS_ASSERTION(mState != PENDING,
|
||||
"Still in a pending state when calling Complete!");
|
||||
|
||||
// Finalize our statements before we try to commit or rollback. If we are
|
||||
// canceling and have statements that think they have pending work, the
|
||||
// rollback will fail.
|
||||
for (PRUint32 i = 0; i < mStatements.Length(); i++) {
|
||||
(void)sqlite3_finalize(mStatements[i]);
|
||||
mStatements[i] = NULL;
|
||||
}
|
||||
|
||||
// Handle our transaction, if we have one
|
||||
if (mTransactionManager) {
|
||||
if (mState == COMPLETED) {
|
||||
@ -512,12 +520,6 @@ private:
|
||||
mTransactionManager = nsnull;
|
||||
}
|
||||
|
||||
// Finalize our statements
|
||||
for (PRUint32 i = 0; i < mStatements.Length(); i++) {
|
||||
(void)sqlite3_finalize(mStatements[i]);
|
||||
mStatements[i] = NULL;
|
||||
}
|
||||
|
||||
// Notify about completion iff we have a callback.
|
||||
if (mCallback) {
|
||||
nsRefPtr<CompletionNotifier> completionEvent =
|
||||
|
Loading…
Reference in New Issue
Block a user