summaryrefslogtreecommitdiff
path: root/core/message_queue.cpp
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <rverschelde@gmail.com>2020-03-04 13:41:38 +0100
committerGitHub <noreply@github.com>2020-03-04 13:41:38 +0100
commita0e33e17fbecc321d45306255814f9581504776c (patch)
tree966803124d47a23266ae3f81e57c7cf8f0456521 /core/message_queue.cpp
parentf83f1d7c9b299f21f818e0ea28c27345f65bde4b (diff)
parent1f209bfc41ef5f2cd63c961262d5d6fe3e03b55a (diff)
Merge pull request #36733 from qarmin/static_analyzer_fixes
Fixes bugs found by Sonarcloud and Coverity
Diffstat (limited to 'core/message_queue.cpp')
-rw-r--r--core/message_queue.cpp5
1 files changed, 4 insertions, 1 deletions
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) {