summaryrefslogtreecommitdiff
path: root/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'main.c')
-rw-r--r--main.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/main.c b/main.c
index a4a36b0..0a8e97a 100644
--- a/main.c
+++ b/main.c
@@ -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;
}