Fix Bug: Free all entries in the fd hashtable when the process exits, w/ E

This commit is contained in:
sBubshait
2024-11-13 17:42:25 +00:00
parent d890c2353e
commit 4f586bb4da
3 changed files with 20 additions and 0 deletions

View File

@@ -325,6 +325,11 @@ process_exit (void)
uint32_t *pd;
printf ("%s: exit(%d)\n", cur->name, cur->exit_status);
/* Clean up all open files */
hash_destroy (&cur->open_files, fd_cleanup);
/* Close the executable file. */
if (cur->exec_file != NULL)
{
lock_acquire (&filesys_lock);