Update Logger.cpp

This commit is contained in:
u6th9d 2018-10-13 23:25:13 +08:00 committed by GitHub
parent 885fb4eca9
commit 354bde290d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -188,7 +188,10 @@ LogUnit* Logger::getLogUnit()
} }
} else { } else {
std::unique_lock<std::mutex> lck(mMtx); std::unique_lock<std::mutex> lck(mMtx);
while (!mStop) { while (true) {
if (!mStop) {
return nullptr;
}
if (!mFree.empty()) { if (!mFree.empty()) {
log = mFree.back(); log = mFree.back();
mFree.resize(mFree.size() - 1); mFree.resize(mFree.size() - 1);