提交 740af8ea 编写于 作者: S slguan

crash while release http

上级 7aebf9d5
...@@ -269,11 +269,12 @@ void httpCleanUpConnect(HttpServer *pServer) { ...@@ -269,11 +269,12 @@ void httpCleanUpConnect(HttpServer *pServer) {
for (i = 0; i < pServer->numOfThreads; ++i) { for (i = 0; i < pServer->numOfThreads; ++i) {
pThread = pServer->pThreads + i; pThread = pServer->pThreads + i;
if (pThread == NULL) continue;
//taosCloseSocket(pThread->pollFd); //taosCloseSocket(pThread->pollFd);
while (pThread->pHead) { //while (pThread->pHead) {
httpCleanUpContext(pThread->pHead, 0); // httpCleanUpContext(pThread->pHead, 0);
} //}
pthread_cancel(pThread->thread); pthread_cancel(pThread->thread);
pthread_join(pThread->thread, NULL); pthread_join(pThread->thread, NULL);
......
...@@ -131,7 +131,11 @@ void httpCleanUpSystem() { ...@@ -131,7 +131,11 @@ void httpCleanUpSystem() {
httpServer->timerHandle = NULL; httpServer->timerHandle = NULL;
} }
httpCleanUpConnect(httpServer); if (httpServer->pThreads != NULL) {
httpCleanUpConnect(httpServer);
httpServer->pThreads = NULL;
}
#if 0 #if 0
httpRemoveAllSessions(httpServer); httpRemoveAllSessions(httpServer);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册