소스 검색

FINALLY fix `lazy_buffer_destroy`

gingerBill 4 년 전
부모
커밋
a4d9847f45
1개의 변경된 파일2개의 추가작업 그리고 2개의 파일을 삭제
  1. 2 2
      core/path/filepath/path.odin

+ 2 - 2
core/path/filepath/path.odin

@@ -170,8 +170,8 @@ clean :: proc(path: string, allocator := context.allocator) -> string {
 	cleaned, new_allocation := from_slash(s);
 	if new_allocation {
 		delete(s);
-		lazy_buffer_destroy(out);
 	}
+	lazy_buffer_destroy(out);
 	return cleaned;
 }
 
@@ -397,8 +397,8 @@ lazy_buffer_string :: proc(lb: ^Lazy_Buffer) -> string {
 	return string(z);
 }
 @(private)
-lazy_buffer_destroy :: proc(lb: ^Lazy_Buffer) {
 	delete(lb.b);
+lazy_buffer_destroy :: proc(lb: ^Lazy_Buffer) {
 	free(lb);
 	lb^ = {};
 }