Index: webrtc/api/peerconnection.cc |
diff --git a/webrtc/api/peerconnection.cc b/webrtc/api/peerconnection.cc |
index ebce40ca5eb0cf37d03243663826ea911eda06c3..08a8b0d41dceef2d3e3178a86700ff66593e13dc 100644 |
--- a/webrtc/api/peerconnection.cc |
+++ b/webrtc/api/peerconnection.cc |
@@ -1441,9 +1441,9 @@ void PeerConnection::OnMessage(rtc::Message* msg) { |
} |
case MSG_GETSTATS: { |
GetStatsMsg* param = static_cast<GetStatsMsg*>(msg->pdata); |
- StatsReports reports; |
- stats_->GetStats(param->track, &reports); |
- param->observer->OnComplete(reports); |
+ std::unique_ptr<StatsReports> reports(new StatsReports); |
+ stats_->GetStats(param->track, reports.get()); |
+ param->observer->OnCompleteReports(std::move(reports)); |
delete param; |
break; |
} |