fix memory leak

This commit is contained in:
Crispy 2024-05-02 13:25:01 +02:00
parent 7112e3cf67
commit 46910fa0e7

View file

@ -26,9 +26,10 @@ main :: proc() {
}
}
print_board :: proc(state: ^[AREA]bool){
print_board :: proc(state: ^[AREA]bool) {
for y := 0; y < HEIGHT; y += 2{
line := strings.builder_make()
defer strings.builder_destroy(&line)
for x in 0..<WIDTH{
top := state[x + y * WIDTH]
bot := state[x + (y+1) * WIDTH ]
@ -47,7 +48,7 @@ print_board :: proc(state: ^[AREA]bool){
}
update_board :: proc(state: ^[AREA]bool){
update_board :: proc(state: ^[AREA]bool) {
new_state : [AREA]bool = ---
for x in 0..<WIDTH {
for y in 0..<HEIGHT {