fix memory leak
This commit is contained in:
parent
7112e3cf67
commit
46910fa0e7
1 changed files with 3 additions and 2 deletions
|
@ -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{
|
for y := 0; y < HEIGHT; y += 2{
|
||||||
line := strings.builder_make()
|
line := strings.builder_make()
|
||||||
|
defer strings.builder_destroy(&line)
|
||||||
for x in 0..<WIDTH{
|
for x in 0..<WIDTH{
|
||||||
top := state[x + y * WIDTH]
|
top := state[x + y * WIDTH]
|
||||||
bot := state[x + (y+1) * 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 = ---
|
new_state : [AREA]bool = ---
|
||||||
for x in 0..<WIDTH {
|
for x in 0..<WIDTH {
|
||||||
for y in 0..<HEIGHT {
|
for y in 0..<HEIGHT {
|
||||||
|
|
Loading…
Reference in a new issue