From 1f209bfc41ef5f2cd63c961262d5d6fe3e03b55a Mon Sep 17 00:00:00 2001 From: qarmin Date: Mon, 2 Mar 2020 19:17:20 +0100 Subject: Fixes bugs found by Sonarcloud and Coverity --- core/message_queue.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'core/message_queue.cpp') diff --git a/core/message_queue.cpp b/core/message_queue.cpp index 235003627e..37207483fe 100644 --- a/core/message_queue.cpp +++ b/core/message_queue.cpp @@ -268,7 +268,10 @@ void MessageQueue::flush() { //using reverse locking strategy _THREAD_SAFE_LOCK_ - ERR_FAIL_COND(flushing); //already flushing, you did something odd + if (flushing) { + _THREAD_SAFE_UNLOCK_ + ERR_FAIL_COND(flushing); //already flushing, you did something odd + } flushing = true; while (read_pos < buffer_end) { -- cgit v1.2.3