C++98 compatible map erase

This commit is contained in:
Robin Gareus 2018-12-27 12:45:36 +01:00
parent 7d1a7b076f
commit d50d8b9d33
No known key found for this signature in database
GPG key ID: A090BCE02CF57F04

View file

@ -1408,7 +1408,6 @@ AlsaAudioBackend::auto_update_midi_devices ()
if (_midi_devices.find (i->first) != _midi_devices.end()) { if (_midi_devices.find (i->first) != _midi_devices.end()) {
continue; continue;
} }
printf ("NEW MIDI DEVICE %s", i->first.c_str());
_midi_devices[i->first] = new AlsaMidiDeviceInfo (false); _midi_devices[i->first] = new AlsaMidiDeviceInfo (false);
set_midi_device_enabled (i->first, true); set_midi_device_enabled (i->first, true);
} }
@ -1418,9 +1417,11 @@ AlsaAudioBackend::auto_update_midi_devices ()
++i; ++i;
continue; continue;
} }
printf ("REMOVE MIDI DEVICE %s", i->first.c_str());
set_midi_device_enabled (i->first, false); 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;
} }
} }