mirror of
https://github.com/vlang/v.git
synced 2025-09-13 14:32:26 +03:00
log: fix valgrind_test.v failure
This commit is contained in:
parent
b9d057118c
commit
f3d2eb1c24
1 changed files with 4 additions and 5 deletions
|
@ -24,12 +24,11 @@ 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:
|
||||
mut p := x.mu
|
||||
p.try_lock()
|
||||
x.mu.try_lock()
|
||||
x.mu.unlock()
|
||||
x.mu.destroy()
|
||||
free(x.mu)
|
||||
x.mu = nil
|
||||
p.unlock()
|
||||
p.destroy()
|
||||
free(p)
|
||||
x.Log.free()
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue