diff --git a/src/qt/qt_settingsfloppycdrom.cpp b/src/qt/qt_settingsfloppycdrom.cpp index 5a578ca61..f6f0fb94c 100644 --- a/src/qt/qt_settingsfloppycdrom.cpp +++ b/src/qt/qt_settingsfloppycdrom.cpp @@ -131,8 +131,15 @@ void SettingsFloppyCDROM::save() { /* Removable devices category */ model = ui->tableViewCDROM->model(); - memset(cdrom, 0, sizeof(cdrom)); for (int i = 0; i < CDROM_NUM; i++) { + cdrom[i].img_fp = NULL; + cdrom[i].priv = NULL; + cdrom[i].ops = NULL; + cdrom[i].image = NULL; + cdrom[i].insert = NULL; + cdrom[i].close = NULL; + cdrom[i].get_volume = NULL; + cdrom[i].get_channel = NULL; cdrom[i].bus_type = model->index(i, 0).data(Qt::UserRole).toUInt(); cdrom[i].res = model->index(i, 0).data(Qt::UserRole + 1).toUInt(); cdrom[i].speed = model->index(i, 1).data(Qt::UserRole).toUInt(); diff --git a/src/qt/qt_settingsotherremovable.cpp b/src/qt/qt_settingsotherremovable.cpp index 2e989cda1..f101afd14 100644 --- a/src/qt/qt_settingsotherremovable.cpp +++ b/src/qt/qt_settingsotherremovable.cpp @@ -128,7 +128,6 @@ SettingsOtherRemovable::~SettingsOtherRemovable() void SettingsOtherRemovable::save() { auto* model = ui->tableViewMO->model(); - memset(mo_drives, 0, sizeof(mo_drives)); for (int i = 0; i < MO_NUM; i++) { mo_drives[i].f = NULL; mo_drives[i].priv = NULL; @@ -138,7 +137,6 @@ void SettingsOtherRemovable::save() { } model = ui->tableViewZIP->model(); - memset(zip_drives, 0, sizeof(zip_drives)); for (int i = 0; i < ZIP_NUM; i++) { zip_drives[i].f = NULL; zip_drives[i].priv = NULL;