Bug 700685: DeleteDatabaseHelper releases objects on the wrong thread. r=bent

This commit is contained in:
Kyle Huey 2011-11-08 12:51:37 -05:00
Родитель f6714f779c
Коммит 025c952e95
1 изменённых файлов: 9 добавлений и 1 удалений

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

@ -537,7 +537,7 @@ public:
const nsAString& aName, const nsAString& aName,
const nsACString& aASCIIOrigin) const nsACString& aASCIIOrigin)
: AsyncConnectionHelper(static_cast<IDBDatabase*>(nsnull), aRequest), : AsyncConnectionHelper(static_cast<IDBDatabase*>(nsnull), aRequest),
mOpenRequest(aRequest), mOpenHelper(aHelper), mOpenHelper(aHelper), mOpenRequest(aRequest),
mCurrentVersion(aCurrentVersion), mName(aName), mCurrentVersion(aCurrentVersion), mName(aName),
mASCIIOrigin(aASCIIOrigin) mASCIIOrigin(aASCIIOrigin)
{ } { }
@ -545,6 +545,14 @@ public:
nsresult GetSuccessResult(JSContext* aCx, nsresult GetSuccessResult(JSContext* aCx,
jsval* aVal); jsval* aVal);
void ReleaseMainThreadObjects()
{
mOpenHelper = nsnull;
mOpenRequest = nsnull;
AsyncConnectionHelper::ReleaseMainThreadObjects();
}
protected: protected:
nsresult DoDatabaseWork(mozIStorageConnection* aConnection); nsresult DoDatabaseWork(mozIStorageConnection* aConnection);
nsresult Init(); nsresult Init();