зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1087622 - b2g memleak during video streaming in v2.1. r=hchang, r=khuey
This commit is contained in:
Родитель
3b2d963a7a
Коммит
4d1234c3e2
|
@ -32,6 +32,7 @@
|
|||
|
||||
#include "mozilla/NullPtr.h"
|
||||
#include "mozilla/mozalloc.h"
|
||||
#include "nsTArray.h"
|
||||
#include "prnetdb.h"
|
||||
#include "prerr.h"
|
||||
#include "prerror.h"
|
||||
|
@ -283,8 +284,9 @@ void ARTPConnection::onPollStreams() {
|
|||
}
|
||||
|
||||
uint32_t pollCount = mStreams.size() * 2;
|
||||
PRPollDesc *pollList = (PRPollDesc *)
|
||||
moz_xcalloc(pollCount, sizeof(PRPollDesc));
|
||||
nsTArray<PRPollDesc> pollList;
|
||||
pollList.AppendElements(pollCount);
|
||||
memset(pollList.Elements(), 0, sizeof(PRPollDesc) * pollCount);
|
||||
|
||||
// |pollIndex| is used to map different RTP & RTCP socket pairs.
|
||||
uint32_t numSocketsToPoll = 0, pollIndex = 0;
|
||||
|
@ -318,8 +320,9 @@ void ARTPConnection::onPollStreams() {
|
|||
return;
|
||||
}
|
||||
|
||||
int32_t numSocketsReadyToRead = PR_Poll(pollList, pollCount,
|
||||
PR_MicrosecondsToInterval(kSocketPollTimeoutUs));
|
||||
const int32_t numSocketsReadyToRead =
|
||||
PR_Poll(pollList.Elements(), pollList.Length(),
|
||||
PR_MicrosecondsToInterval(kSocketPollTimeoutUs));
|
||||
|
||||
if (numSocketsReadyToRead > 0) {
|
||||
pollIndex = 0;
|
||||
|
|
Загрузка…
Ссылка в новой задаче