qt: Fix crashes on loading non-existent ZIP/MO images

This commit is contained in:
Cacodemon345
2022-06-24 17:15:40 +06:00
parent 74f86753dd
commit d9ee5d43bb
2 changed files with 9 additions and 6 deletions

View File

@@ -501,6 +501,7 @@ void MediaMenu::zipEject(int i) {
zip_t *dev = (zip_t *) zip_drives[i].priv;
zip_disk_close(dev);
zip_drives[i].image_path[0] = 0;
if (zip_drives[i].bus_type) {
/* Signal disk change to the emulated machine. */
zip_insert(dev);
@@ -600,6 +601,7 @@ void MediaMenu::moEject(int i) {
mo_t *dev = (mo_t *) mo_drives[i].priv;
mo_disk_close(dev);
mo_drives[i].image_path[0] = 0;
if (mo_drives[i].bus_type) {
/* Signal disk change to the emulated machine. */
mo_insert(dev);