Bug 713221 - Close database in test_AsXXX_helpers.cpp. r=mak.
authorRafael Ávila de Espíndola <respindola@mozilla.com>
Wed, 28 Dec 2011 09:32:19 -0500
changeset 84676 9ff526c636cd7d0c32c21906ed9818e15a2e511b
parent 84675 9bb39109e7246f6c7dc16295c242c57d0d7e9be5
child 84677 721203297177bcf51d6757d72e2f5786921a3c43
push idunknown
push userunknown
push dateunknown
reviewersmak
bugs713221
milestone12.0a1
Bug 713221 - Close database in test_AsXXX_helpers.cpp. r=mak.
storage/test/test_AsXXX_helpers.cpp
--- a/storage/test/test_AsXXX_helpers.cpp
+++ b/storage/test/test_AsXXX_helpers.cpp
@@ -99,20 +99,22 @@ test_asyncNULLFallback()
 {
   nsCOMPtr<mozIStorageConnection> db(getMemoryDatabase());
 
   nsCOMPtr<mozIStorageAsyncStatement> stmt;
   (void)db->CreateAsyncStatement(NS_LITERAL_CSTRING(
     "SELECT NULL"
   ), getter_AddRefs(stmt));
 
+  nsCOMPtr<mozIStoragePendingStatement> pendingStmt;
+  do_check_true(NS_SUCCEEDED(stmt->ExecuteAsync(nsnull, getter_AddRefs(pendingStmt))));
+  do_check_true(pendingStmt);
+  stmt->Finalize();
   nsRefPtr<Spinner> asyncSpin(new Spinner());
-  nsCOMPtr<mozIStoragePendingStatement> pendingStmt;
-  do_check_true(NS_SUCCEEDED(stmt->ExecuteAsync(asyncSpin, getter_AddRefs(pendingStmt))));
-  do_check_true(pendingStmt);
+  db->AsyncClose(asyncSpin);
   asyncSpin->SpinUntilCompleted();
 
 }
 
 void (*gTests[])(void) = {
   test_NULLFallback
 , test_asyncNULLFallback
 };