| 598 | } |
| 599 | |
| 600 | void NetManager::Clear() |
| 601 | { |
| 602 | AutoCrit autoCrit(mThreadPool.mCritSect); |
| 603 | BF_ASSERT(mWaitingResult == NULL); // The debugger thread shouldn't be waiting on anything, it should be detached at this point |
| 604 | |
| 605 | for (auto job : mThreadPool.mJobs) |
| 606 | { |
| 607 | auto netRequest = (NetRequest*)job; |
| 608 | netRequest->Cancel(); |
| 609 | } |
| 610 | |
| 611 | for (auto kv : mCachedResults) |
| 612 | { |
| 613 | NetResult* netResult = kv.mValue; |
| 614 | if (netResult->mCurRequest != NULL) |
| 615 | netResult->mRemoved = true; |
| 616 | else |
| 617 | delete netResult; |
| 618 | } |
| 619 | mCachedResults.Clear(); |
| 620 | |
| 621 | for (auto netResult : mOldResults) |
| 622 | { |
| 623 | delete netResult; |
| 624 | } |
| 625 | mOldResults.Clear(); |
| 626 | } |
| 627 | |
| 628 | void NetManager::CancelCurrent() |
| 629 | { |