Fix locking release for updating logq

This commit is contained in:
image 2020-08-31 21:57:54 -04:00
parent 7ae7d637a3
commit dd01a9ce4a

View file

@ -213,11 +213,12 @@ static void WriteQueuedLogs(int count) {
break;
}
mlogqs.releasewritelock();
//if we have no logs to write, we're done
if ((logq = pending_head.next) == &pending_tail)
{
mlogqs.releasewritelock();
return;
}
while (logq != &pending_tail) {
if (log_type_info[logq->log_type].console) {
@ -256,6 +257,8 @@ static void WriteQueuedLogs(int count) {
tmp = logq;
logq = logq->next;
mlogqs.releasewritelock();
free(tmp->text);
free(tmp);
}