Core/Shared: Fix world and auth crash on shutdown (PCQ & DbWorker)

Fixes #12704
This commit is contained in:
DDuarte
2014-08-02 19:30:55 +01:00
parent 56c0581e55
commit cb453fa093
2 changed files with 3 additions and 3 deletions

View File

@@ -50,7 +50,7 @@ void DatabaseWorker::WorkerThread()
_queue->WaitAndPop(operation);
if (_cancelationToken)
if (_cancelationToken || !operation)
return;
operation->SetConnection(_connection);

View File

@@ -58,7 +58,7 @@ public:
{
std::lock_guard<std::mutex> lock(_queueLock);
if (_queue.empty())
if (_queue.empty() || _shutdown)
return false;
value = _queue.front();
@@ -77,7 +77,7 @@ public:
_condition.wait(lock);
}
if (_queue.empty())
if (_queue.empty() || _shutdown)
return;
value = _queue.front();