fix: file free dangling pointer

This commit is contained in:
2026-05-16 13:29:00 +02:00
parent ca3e523f93
commit 43ce38f2f4
4 changed files with 4 additions and 4 deletions
+1 -1
View File
@@ -123,7 +123,7 @@ void file_write(const char *path, const StringArray *lines) {
fclose(file_pointer);
}
void file_free(const File *file) {
void file_free(File *file) {
if (!file->error) {
free(file->content);
}
+1 -1
View File
@@ -13,6 +13,6 @@ void file_write(const char *path, const StringArray *lines);
void file_dump(const char *path, const char *content);
void file_free(const File *file);
void file_free(File *file);
#endif /* FILE_H */
+1 -1
View File
@@ -134,7 +134,7 @@ void project_reload(Project *project, void (*reload_callback)(unsigned int)) {
}
}
void project_free(const Project *project) {
void project_free(Project *project) {
for (unsigned int i = 0; i < project->frag_count; i++) {
file_free(&project->fragment_shaders[i][0]);
}
+1 -1
View File
@@ -8,6 +8,6 @@ void project_init(Project *project, const char *project_path,
void project_reload(Project *project, void (*reload_callback)(unsigned int));
void project_free(const Project *project);
void project_free(Project *project);
#endif /* PROJECT_H */