mirror of
https://github.com/vlang/v.git
synced 2025-09-13 14:32:26 +03:00
log: fix Unhandled Exception
on windows 7 (#24803)
This commit is contained in:
parent
ce33cc490f
commit
81e84a6a01
1 changed files with 3 additions and 2 deletions
|
@ -24,8 +24,9 @@ pub fn new_thread_safe_log() &ThreadSafeLog {
|
|||
pub fn (mut x ThreadSafeLog) free() {
|
||||
unsafe {
|
||||
// make sure other threads are not in the blocks protected by the mutex:
|
||||
x.mu.try_lock()
|
||||
x.mu.unlock()
|
||||
if x.mu.try_lock() {
|
||||
x.mu.unlock()
|
||||
}
|
||||
x.mu.destroy()
|
||||
free(x.mu)
|
||||
x.mu = nil
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue