mirror of
https://github.com/vlang/v.git
synced 2025-09-13 22:42: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() {
|
pub fn (mut x ThreadSafeLog) free() {
|
||||||
unsafe {
|
unsafe {
|
||||||
// make sure other threads are not in the blocks protected by the mutex:
|
// make sure other threads are not in the blocks protected by the mutex:
|
||||||
x.mu.try_lock()
|
if x.mu.try_lock() {
|
||||||
x.mu.unlock()
|
x.mu.unlock()
|
||||||
|
}
|
||||||
x.mu.destroy()
|
x.mu.destroy()
|
||||||
free(x.mu)
|
free(x.mu)
|
||||||
x.mu = nil
|
x.mu = nil
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue