Browse Source

Fix locking release for updating logq

image 3 years ago
parent
commit
dd01a9ce4a
1 changed files with 5 additions and 2 deletions
  1. 5 2
      EQ2/source/common/Log.cpp

+ 5 - 2
EQ2/source/common/Log.cpp

@@ -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);
 	}