Procházet zdrojové kódy

Merge pull request #2272 from sir-w7/fix/darwin_mem_leak

Fixed memory leak in dir_darwin.odin.
gingerBill před 2 roky
rodič
revize
b00c4a6a8f
1 změnil soubory, kde provedl 2 přidání a 1 odebrání
  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, err = absolute_path_from_handle(fd)
-
 	if err != ERROR_NONE {
 		return
 	}
 
+	defer delete(dirpath)
+
 	n := n
 	size := n
 	if n <= 0 {