mirror of
https://github.com/odin-lang/Odin.git
synced 2026-06-06 10:44:06 +00:00
Clean up filepath.lazy_buffer memory leak
This commit is contained in:
@@ -169,7 +169,7 @@ clean :: proc(path: string, allocator := context.allocator) -> string {
|
||||
s := lazy_buffer_string(out);
|
||||
cleaned, new_allocation := from_slash(s);
|
||||
if new_allocation {
|
||||
delete(s);
|
||||
lazy_buffer_destroy(s);
|
||||
}
|
||||
return cleaned;
|
||||
}
|
||||
@@ -395,3 +395,9 @@ lazy_buffer_string :: proc(lb: ^Lazy_Buffer) -> string {
|
||||
copy(z[len(x):], y);
|
||||
return string(z);
|
||||
}
|
||||
@(private)
|
||||
lazy_buffer_destroy :: proc(lb: ^Lazy_Buffer) {
|
||||
delete(lb.b);
|
||||
delete(lb);
|
||||
lb^ = {};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user