mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-27 04:12:40 +01:00
Core/Shared: Fix world and auth crash on shutdown (PCQ & DbWorker)
Fixes #12704
This commit is contained in:
@@ -50,7 +50,7 @@ void DatabaseWorker::WorkerThread()
|
||||
|
||||
_queue->WaitAndPop(operation);
|
||||
|
||||
if (_cancelationToken)
|
||||
if (_cancelationToken || !operation)
|
||||
return;
|
||||
|
||||
operation->SetConnection(_connection);
|
||||
|
||||
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user