зеркало из https://github.com/mozilla/gecko-dev.git
Bug 461263 - Race condition exists with mozStorageTransaction
While the race was technically "safe", we could have possibly wrongly tried to commit or rollback. This changeset makes us operate sanely in all conditions. r=bent
This commit is contained in:
Родитель
799d2cf3af
Коммит
18700696dc
|
@ -69,13 +69,9 @@ public:
|
|||
mCommitOnComplete(aCommitOnComplete),
|
||||
mCompleted(PR_FALSE)
|
||||
{
|
||||
if (mConnection) {
|
||||
PRBool transactionInProgress = PR_FALSE;
|
||||
mConnection->GetTransactionInProgress(&transactionInProgress);
|
||||
mHasTransaction = ! transactionInProgress;
|
||||
if (mHasTransaction)
|
||||
mConnection->BeginTransactionAs(aType);
|
||||
}
|
||||
// We won't try to get a transaction if one is already in progress.
|
||||
if (mConnection)
|
||||
mHasTransaction = NS_SUCCEEDED(mConnection->BeginTransactionAs(aType));
|
||||
}
|
||||
~mozStorageTransaction()
|
||||
{
|
||||
|
|
Загрузка…
Ссылка в новой задаче