Skip to content

Commit bb610bb

Browse files
committed
log:fix Unhandled Exception on windows 7
1 parent aed5807 commit bb610bb

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

vlib/log/safe_log.v

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,9 @@ pub fn new_thread_safe_log() &ThreadSafeLog {
2424
pub fn (mut x ThreadSafeLog) free() {
2525
unsafe {
2626
// make sure other threads are not in the blocks protected by the mutex:
27-
x.mu.try_lock()
28-
x.mu.unlock()
27+
if x.mu.try_lock() {
28+
x.mu.unlock()
29+
}
2930
x.mu.destroy()
3031
free(x.mu)
3132
x.mu = nil

0 commit comments

Comments
 (0)