mirror of
https://github.com/ClassiCube/ClassiCube.git
synced 2025-09-15 18:45:23 -04:00
C client: Fix crash on process exit on linux
This commit is contained in:
parent
cd1961f588
commit
a88d912859
@ -235,20 +235,21 @@ static void AsyncDownloader_CompleteResult(struct AsyncRequest* request) {
|
||||
}
|
||||
|
||||
static void AsyncDownloader_WorkerFunc(void) {
|
||||
while (true) {
|
||||
for (;;) {
|
||||
struct AsyncRequest request;
|
||||
bool hasRequest = false;
|
||||
bool hasRequest = false, stop;
|
||||
|
||||
Mutex_Lock(async_pendingMutex);
|
||||
{
|
||||
if (async_terminate) return;
|
||||
if (async_pending.Count) {
|
||||
stop = async_terminate;
|
||||
if (!stop && async_pending.Count) {
|
||||
request = async_pending.Requests[0];
|
||||
hasRequest = true;
|
||||
AsyncRequestList_RemoveAt(&async_pending, 0);
|
||||
}
|
||||
}
|
||||
Mutex_Unlock(async_pendingMutex);
|
||||
if (stop) return;
|
||||
|
||||
if (hasRequest) {
|
||||
Platform_LogConst("Got something to do!");
|
||||
|
Loading…
x
Reference in New Issue
Block a user