From 7ff00d39bda9ac24ef6a5faea609784876bc678e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Victor=20Moror=C3=B3?= Date: Wed, 5 Aug 2026 08:45:01 -0300 Subject: [PATCH] os: resolve relative path before SHFileOperationW in remove_all (windows) --- core/os/path_windows.odin | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/core/os/path_windows.odin b/core/os/path_windows.odin index 83100ad69..753f1665f 100644 --- a/core/os/path_windows.odin +++ b/core/os/path_windows.odin @@ -84,7 +84,13 @@ _remove_all :: proc(path: string) -> Error { } temp_allocator := TEMP_ALLOCATOR_GUARD({}) - dir := win32_utf8_to_wstring(path, temp_allocator) or_return + + // SHFileOperationW is documented as not thread safe with relative paths. + abs_path := path + if !_is_absolute_path(path) { + abs_path = _get_absolute_path(path, temp_allocator) or_return + } + dir := win32_utf8_to_wstring(abs_path, temp_allocator) or_return empty: [1]u16