Browse Source

Fixed memory leak in dir_darwin.odin.

sir-w7 2 years ago
parent
commit
67c1b364c4
1 changed files with 2 additions and 1 deletions
  1. 2 1
      core/os/dir_darwin.odin

+ 2 - 1
core/os/dir_darwin.odin

@@ -14,11 +14,12 @@ read_dir :: proc(fd: Handle, n: int, allocator := context.allocator) -> (fi: []F
 
 
 	dirpath: string
 	dirpath: string
 	dirpath, err = absolute_path_from_handle(fd)
 	dirpath, err = absolute_path_from_handle(fd)
-
 	if err != ERROR_NONE {
 	if err != ERROR_NONE {
 		return
 		return
 	}
 	}
 
 
+	defer delete(dirpath)
+
 	n := n
 	n := n
 	size := n
 	size := n
 	if n <= 0 {
 	if n <= 0 {