diff options
author | Aryadev Chavali <aryadev@aryadevchavali.com> | 2023-08-25 20:03:23 +0100 |
---|---|---|
committer | Aryadev Chavali <aryadev@aryadevchavali.com> | 2023-08-25 20:03:23 +0100 |
commit | 21c03264e65042db3b5856fba8a6cd1099438f96 (patch) | |
tree | da4208818b6703ffcff557574b030be6fb42984e /main.c | |
parent | 58970e8a68583e61e93091989af335cdac218085 (diff) | |
download | abelian-sandpile-21c03264e65042db3b5856fba8a6cd1099438f96.tar.gz abelian-sandpile-21c03264e65042db3b5856fba8a6cd1099438f96.tar.bz2 abelian-sandpile-21c03264e65042db3b5856fba8a6cd1099438f96.zip |
(main|file-handler)~fixed some stuff
Big bug with file handler: I can write data well, but reading it
causes some trace error which I cannot be bothered to fix. So I'll
just work on making the step function way more efficient.
Diffstat (limited to 'main.c')
-rw-r--r-- | main.c | 7 |
1 files changed, 5 insertions, 2 deletions
@@ -116,9 +116,12 @@ int main(void) } if (state.thread_alive) - pthread_cancel(step_thread); + { + state.thread_alive = false; + pthread_join(step_thread, NULL); + } - write_to_file(&state, "data.out"); CloseWindow(); + free(state.data); return 0; } |