mirror of
https://github.com/alliedmodders/amxmodx.git
synced 2024-12-25 06:15:37 +03:00
Queries in plugin_end() now resolve correctly.
This commit is contained in:
parent
408f61c6d6
commit
db5c9c114e
@ -17,7 +17,7 @@ void ShutdownThreading()
|
|||||||
{
|
{
|
||||||
if (g_pWorker)
|
if (g_pWorker)
|
||||||
{
|
{
|
||||||
g_pWorker->Stop(true);
|
g_pWorker->Stop(false);
|
||||||
delete g_pWorker;
|
delete g_pWorker;
|
||||||
g_pWorker = NULL;
|
g_pWorker = NULL;
|
||||||
}
|
}
|
||||||
@ -312,11 +312,32 @@ void StartFrame()
|
|||||||
void OnPluginsUnloading()
|
void OnPluginsUnloading()
|
||||||
{
|
{
|
||||||
if (!g_pWorker)
|
if (!g_pWorker)
|
||||||
|
{
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
g_pWorker->Stop(false);
|
g_pWorker->Stop(false);
|
||||||
delete g_pWorker;
|
delete g_pWorker;
|
||||||
g_pWorker = NULL;
|
g_pWorker = NULL;
|
||||||
|
|
||||||
|
g_QueueLock->Lock();
|
||||||
|
size_t remaining = g_ThreadQueue.size();
|
||||||
|
if (remaining)
|
||||||
|
{
|
||||||
|
MysqlThread *kmThread;
|
||||||
|
do
|
||||||
|
{
|
||||||
|
kmThread = g_ThreadQueue.front();
|
||||||
|
g_ThreadQueue.pop();
|
||||||
|
g_QueueLock->Unlock();
|
||||||
|
kmThread->Execute();
|
||||||
|
kmThread->Invalidate();
|
||||||
|
g_FreeThreads.push(kmThread);
|
||||||
|
g_QueueLock->Lock();
|
||||||
|
} while (!g_ThreadQueue.empty());
|
||||||
|
}
|
||||||
|
|
||||||
|
g_QueueLock->Unlock();
|
||||||
}
|
}
|
||||||
|
|
||||||
/***********************
|
/***********************
|
||||||
|
Loading…
Reference in New Issue
Block a user