Bug 1161619: RunStatsQuery leak fix. r=jib
authorPaul Kerr [:pkerr] <pkerr@mozilla.com>
Wed, 06 May 2015 13:01:59 -0700
changeset 274051 b1d38f4141afb97e8908b439d3e94d794e8fb1dc
parent 274050 e85ff3b95bd99cd3b955966ffdf00cd700a68a52
child 274052 3bf223d7eedd8e192d465582691c1510d2f656c9
push id863
push userraliiev@mozilla.com
push dateMon, 03 Aug 2015 13:22:43 +0000
treeherdermozilla-release@f6321b14228d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjib
bugs1161619
milestone40.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 1161619: RunStatsQuery leak fix. r=jib
media/webrtc/signaling/src/peerconnection/WebrtcGlobalInformation.cpp
--- a/media/webrtc/signaling/src/peerconnection/WebrtcGlobalInformation.cpp
+++ b/media/webrtc/signaling/src/peerconnection/WebrtcGlobalInformation.cpp
@@ -399,17 +399,17 @@ BuildStatsQueryList(
 
 static nsresult
 RunStatsQuery(
   const std::map<const std::string, PeerConnectionImpl *>& aPeerConnections,
   const nsAString& aPcIdFilter,
   WebrtcGlobalChild* aThisChild,
   const int aRequestId)
 {
-  auto* queries = new RTCStatsQueries;
+  nsAutoPtr<RTCStatsQueries> queries(new RTCStatsQueries);
   nsresult rv = BuildStatsQueryList(aPeerConnections, aPcIdFilter, queries);
 
   if (NS_FAILED(rv)) {
     return rv;
   }
 
   nsCOMPtr<nsIEventTarget> stsThread =
     do_GetService(NS_SOCKETTRANSPORTSERVICE_CONTRACTID, &rv);
@@ -419,17 +419,17 @@ RunStatsQuery(
   } else if (!stsThread) {
     return NS_ERROR_FAILURE;
   }
 
   rv = RUN_ON_THREAD(stsThread,
                      WrapRunnableNM(&GetAllStats_s,
                                     aThisChild,
                                     aRequestId,
-                                    nsAutoPtr<RTCStatsQueries>(queries)),
+                                    queries),
                      NS_DISPATCH_NORMAL);
   return rv;
 }
 
 void
 WebrtcGlobalInformation::GetAllStats(
   const GlobalObject& aGlobal,
   WebrtcGlobalStatisticsCallback& aStatsCallback,