C++98 compatible map erase

This commit is contained in:
Robin Gareus
2018-12-27 12:45:36 +01:00
parent 7d1a7b076f
commit d50d8b9d33

View File

@@ -1408,7 +1408,6 @@ AlsaAudioBackend::auto_update_midi_devices ()
if (_midi_devices.find (i->first) != _midi_devices.end()) {
continue;
}
printf ("NEW MIDI DEVICE %s", i->first.c_str());
_midi_devices[i->first] = new AlsaMidiDeviceInfo (false);
set_midi_device_enabled (i->first, true);
}
@@ -1418,9 +1417,11 @@ AlsaAudioBackend::auto_update_midi_devices ()
++i;
continue;
}
printf ("REMOVE MIDI DEVICE %s", i->first.c_str());
set_midi_device_enabled (i->first, false);
i = _midi_devices.erase (i);
std::map<std::string, struct AlsaMidiDeviceInfo *>::iterator tmp = i;
++tmp;
_midi_devices.erase (i);
i = tmp;
}
}