mirror of
https://github.com/Ed94/Odin.git
synced 2026-08-06 15:48:51 +00:00
os2: fix leak and always close directory
This commit is contained in:
@@ -61,6 +61,7 @@ _remove_all :: proc(path: string) -> Error {
|
||||
if dir == nil {
|
||||
return _get_platform_error()
|
||||
}
|
||||
defer posix.closedir(dir)
|
||||
|
||||
for {
|
||||
posix.set_errno(.NONE)
|
||||
@@ -91,7 +92,6 @@ _remove_all :: proc(path: string) -> Error {
|
||||
if posix.rmdir(cpath) != .OK {
|
||||
return _get_platform_error()
|
||||
}
|
||||
posix.closedir(dir)
|
||||
return nil
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user