зеркало из https://github.com/mozilla/gecko-dev.git
Bug 844705 - Should send socket data in main thread, r=echou
This commit is contained in:
Родитель
2f417022fb
Коммит
7f34829d6d
|
@ -160,7 +160,7 @@ public:
|
|||
MOZ_ASSERT(!NS_IsMainThread());
|
||||
|
||||
uint32_t numRead;
|
||||
char* buf = new char[mAvailablePacketSize];
|
||||
nsAutoArrayPtr<char> buf(new char[mAvailablePacketSize]);
|
||||
|
||||
// function inputstream->Read() only works on non-main thread
|
||||
nsresult rv = mInputStream->Read(buf, mAvailablePacketSize, &numRead);
|
||||
|
@ -176,7 +176,7 @@ public:
|
|||
}
|
||||
|
||||
nsRefPtr<SendSocketDataTask> task =
|
||||
new SendSocketDataTask((uint8_t*)buf, numRead);
|
||||
new SendSocketDataTask((uint8_t*)buf.forget(), numRead);
|
||||
if (NS_FAILED(NS_DispatchToMainThread(task))) {
|
||||
NS_WARNING("Failed to dispatch to main thread!");
|
||||
return NS_ERROR_FAILURE;
|
||||
|
|
Загрузка…
Ссылка в новой задаче