Browse Source

Fix filepath.lazy_buffer

gingerBill 4 years ago
parent
commit
8aa6d70dec
1 changed files with 3 additions and 2 deletions
  1. 3 2
      core/path/filepath/path.odin

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

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