Bug 1193022 - clean up reference-counting in storage/; r=mak
authorNathan Froyd <froydnj@mozilla.com>
Wed, 01 Jul 2015 13:11:11 -0400
changeset 290066 2b5a337a30dc5b7e82d768bbb726136f13b33f98
parent 290065 b96e95b7b4b946b5522374444ec94d6b163e0db3
child 290067 e5258869f5dd94e2d36e0517bcd4e899818387ad
push id5245
push userraliiev@mozilla.com
push dateThu, 29 Oct 2015 11:30:51 +0000
treeherdermozilla-beta@dac831dc1bd0 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmak
bugs1193022
milestone43.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1193022 - clean up reference-counting in storage/; r=mak
storage/mozStorageAsyncStatementExecution.cpp
storage/mozStorageConnection.cpp
--- a/storage/mozStorageAsyncStatementExecution.cpp
+++ b/storage/mozStorageAsyncStatementExecution.cpp
@@ -186,17 +186,17 @@ AsyncExecuteStatements::execute(Statemen
   if (!target) {
     return NS_ERROR_NOT_AVAILABLE;
   }
 
   nsresult rv = target->Dispatch(event, NS_DISPATCH_NORMAL);
   NS_ENSURE_SUCCESS(rv, rv);
 
   // Return it as the pending statement object and track it.
-  NS_ADDREF(*_stmt = event);
+  event.forget(_stmt);
   return NS_OK;
 }
 
 AsyncExecuteStatements::AsyncExecuteStatements(StatementDataArray &aStatements,
                                                Connection *aConnection,
                                                sqlite3 *aNativeConnection,
                                                mozIStorageStatementCallback *aCallback)
 : mConnection(aConnection)
--- a/storage/mozStorageConnection.cpp
+++ b/storage/mozStorageConnection.cpp
@@ -1578,17 +1578,17 @@ Connection::ExecuteSimpleSQLAsync(const 
   }
 
   nsCOMPtr<mozIStoragePendingStatement> pendingStatement;
   rv = stmt->ExecuteAsync(aCallback, getter_AddRefs(pendingStatement));
   if (NS_FAILED(rv)) {
     return rv;
   }
 
-  NS_ADDREF(*_handle = pendingStatement);
+  pendingStatement.forget(_handle);
   return rv;
 }
 
 NS_IMETHODIMP
 Connection::TableExists(const nsACString &aTableName,
                         bool *_exists)
 {
     return databaseElementExists(TABLE, aTableName, _exists);