diff options
author | qarmin <mikrutrafal54@gmail.com> | 2020-03-02 19:17:20 +0100 |
---|---|---|
committer | qarmin <mikrutrafal54@gmail.com> | 2020-03-02 19:17:20 +0100 |
commit | 1f209bfc41ef5f2cd63c961262d5d6fe3e03b55a (patch) | |
tree | d754f5b7fad41653651ee820969ca484914c5fa3 /core/message_queue.cpp | |
parent | 0c22f5a4476d80b43017b2032f60039ce75e49a9 (diff) |
Fixes bugs found by Sonarcloud and Coverity
Diffstat (limited to 'core/message_queue.cpp')
-rw-r--r-- | core/message_queue.cpp | 5 |
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) { |