Do not attempt to free the task file of shadowed IDE devices, fixes potential crashes when shutting down the emulator.

This commit is contained in:
OBattler
2023-11-05 22:31:21 +01:00
parent 5ee5b858d3
commit 70a2ba0581

View File

@@ -2651,7 +2651,8 @@ ide_board_close(int board)
if (dev->type == IDE_ATAPI) if (dev->type == IDE_ATAPI)
dev->tf->atastat = DRDY_STAT | DSC_STAT; dev->tf->atastat = DRDY_STAT | DSC_STAT;
else if (dev->tf != NULL) {
if ((dev->type == IDE_HDD) && (dev->tf != NULL)) {
free(dev->tf); free(dev->tf);
dev->tf = NULL; dev->tf = NULL;
} }