Fixed thread reference leak in network code.
This commit is contained in:
parent
a59ad51ce2
commit
455d0210b2
|
@ -827,7 +827,10 @@ const int*
|
||||||
CArchNetworkBSD::getUnblockPipe()
|
CArchNetworkBSD::getUnblockPipe()
|
||||||
{
|
{
|
||||||
CArchMultithreadPosix* mt = CArchMultithreadPosix::getInstance();
|
CArchMultithreadPosix* mt = CArchMultithreadPosix::getInstance();
|
||||||
return getUnblockPipeForThread(mt->newCurrentThread());
|
CArchThread thread = mt->newCurrentThread();
|
||||||
|
const int* p = getUnblockPipeForThread(thread);
|
||||||
|
ARCH->closeThread(thread);
|
||||||
|
return p;
|
||||||
}
|
}
|
||||||
|
|
||||||
const int*
|
const int*
|
||||||
|
|
|
@ -418,6 +418,7 @@ CArchNetworkWinsock::pollSocket(CPollEntry pe[], int num, double timeout)
|
||||||
CArchMultithreadWindows* mt = CArchMultithreadWindows::getInstance();
|
CArchMultithreadWindows* mt = CArchMultithreadWindows::getInstance();
|
||||||
CArchThread thread = mt->newCurrentThread();
|
CArchThread thread = mt->newCurrentThread();
|
||||||
WSAEVENT* unblockEvent = (WSAEVENT*)mt->getNetworkDataForThread(thread);
|
WSAEVENT* unblockEvent = (WSAEVENT*)mt->getNetworkDataForThread(thread);
|
||||||
|
ARCH->closeThread(thread);
|
||||||
if (unblockEvent == NULL) {
|
if (unblockEvent == NULL) {
|
||||||
unblockEvent = new WSAEVENT;
|
unblockEvent = new WSAEVENT;
|
||||||
*unblockEvent = WSACreateEvent_winsock();
|
*unblockEvent = WSACreateEvent_winsock();
|
||||||
|
|
Loading…
Reference in New Issue