mirror of
https://github.com/sbrow/envr.git
synced 2026-06-27 18:48:33 -04:00
fix: Fixed memory leaks in the db.
This commit is contained in:
@@ -26,6 +26,7 @@ cmd_list :: proc(cmd: ^Command) {
|
||||
return
|
||||
}
|
||||
defer delete(rows)
|
||||
defer for &row in rows {delete_envfile(&row)}
|
||||
|
||||
if terminal.is_terminal(os.stdout) {
|
||||
headers := []string{"Directory", "Path"}
|
||||
@@ -34,7 +35,7 @@ cmd_list :: proc(cmd: ^Command) {
|
||||
for row in rows {
|
||||
dir_str := strings.concatenate({row.Dir, "/"}, context.temp_allocator)
|
||||
filename := filepath.base(row.Path)
|
||||
row_slice := make([]string, 2)
|
||||
row_slice := make([]string, 2, context.temp_allocator)
|
||||
row_slice[0] = dir_str
|
||||
row_slice[1] = filename
|
||||
append(&table_rows, row_slice)
|
||||
|
||||
Reference in New Issue
Block a user