From e4bae939aea065fa5745e224fc0eb12d5136d1c4 Mon Sep 17 00:00:00 2001 From: dam Date: Mon, 27 Mar 2023 17:54:24 +0100 Subject: Fixing memory leaks. --- ttt.jai | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) (limited to 'ttt.jai') diff --git a/ttt.jai b/ttt.jai index 5848a35..2dac60b 100644 --- a/ttt.jai +++ b/ttt.jai @@ -1213,15 +1213,16 @@ void *mem_alloc(size_t mem_size, const char *error_tag) { */ free_memory :: () { print(">> FREE <<\n"); - /* TODO - reset_database(&database); - reset_database(&archive); - free(string_buffer); string_buffer = NULL; - free(app_directory); app_directory = NULL; - free(db_file_path); db_file_path = NULL; - free(ar_file_path); ar_file_path = NULL; - */ + // TODO + //reset_database(&database); + //reset_database(&archive); + + //free(string_buffer); string_buffer = NULL; + free(app_directory); + free(db_file_path); + free(ar_file_path); + //reset_temporary_storage(); } /* @@ -1304,7 +1305,7 @@ main :: () { home_dir = "."; } - home_path, success_path := get_absolute_path(home_dir); // Returns temporary memory. + home_path, success_path := get_absolute_path(home_dir); // Returns temporary memory. TODO LEAK if success_path == false { print_error("Failed to find home directory '%'.", home_dir); return; -- cgit v1.2.3