diff --git a/src/file.c b/src/file.c index e799dd9..adb00dd 100644 --- a/src/file.c +++ b/src/file.c @@ -133,5 +133,6 @@ void file_write(const char *path, const StringArray *lines) { void file_free(File *file) { if (!file->error && file->content != NULL) { free(file->content); + file->content = NULL; } } diff --git a/src/project.c b/src/project.c index 4eda19a..9cc0254 100644 --- a/src/project.c +++ b/src/project.c @@ -144,9 +144,7 @@ void project_reload(Project *project, void (*reload_callback)(unsigned int)) { void project_free(Project *project) { for (unsigned int i = 0; i < project->frag_count; i++) { - for (unsigned int j = 0; j < MAX_SUB_FILE + 1; j++) { - file_free(&project->fragment_shaders[i][j]); - } + file_free(&project->fragment_shaders[i][0]); } config_file_free(&project->config);