소스 검색

Fix worker bug

xcbosa-itx 2 년 전
부모
커밋
6994abf3c9
2개의 변경된 파일3개의 추가작업 그리고 1개의 파일을 삭제
  1. 2 1
      processor/RequestProcessTask.cpp
  2. 1 0
      processor/RequestProcessorManager.cpp

+ 2 - 1
processor/RequestProcessTask.cpp

@@ -18,7 +18,8 @@ namespace xc {
             if (this->httpDiscarded) {
                 delete responseData;
                 this->response = nullptr;
-                //delete this; // Todo: Memory Lake
+                delete this;
+                // Todo: Memory Lake
             }
         }
 

+ 1 - 0
processor/RequestProcessorManager.cpp

@@ -26,6 +26,7 @@ namespace xc {
                 taskQueueMutex.lock();
                 if (!taskQueue.empty()) {
                     RequestProcessTask task = *taskQueue.front();
+                    taskQueue.pop_front();
                     taskQueueMutex.unlock();
                     return task;
                 }