aboutsummaryrefslogtreecommitdiff
path: root/src/common/util_windows.odin
diff options
context:
space:
mode:
Diffstat (limited to 'src/common/util_windows.odin')
-rw-r--r--src/common/util_windows.odin10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/common/util_windows.odin b/src/common/util_windows.odin
index 194bd4d..716d4be 100644
--- a/src/common/util_windows.odin
+++ b/src/common/util_windows.odin
@@ -32,10 +32,10 @@ get_case_sensitive_path :: proc(path: string, allocator := context.temp_allocato
file := win32.CreateFileW(&wide[0], 0, win32.FILE_SHARE_READ, nil, win32.OPEN_EXISTING, win32.FILE_FLAG_BACKUP_SEMANTICS, nil)
if(file == win32.INVALID_HANDLE)
- {
+ {
log_last_error()
- return "";
- }
+ return "";
+ }
buffer := make([]u16, 512, context.temp_allocator)
@@ -43,6 +43,8 @@ get_case_sensitive_path :: proc(path: string, allocator := context.temp_allocato
res, _ := win32.utf16_to_utf8(buffer[4:], allocator)
+ win32.CloseHandle(file)
+
return res
}
@@ -127,4 +129,4 @@ run_executable :: proc(command: string, stdout: ^[]byte) -> (u32, bool, []byte)
win32.CloseHandle(stdout_read)
return exit_code, true, stdout[0:index]
-} \ No newline at end of file
+}