Browse Source

Fix worker bug

xcbosa-itx 2 years ago
parent
commit
6994abf3c9
2 changed files with 3 additions and 1 deletions
  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;
                 }