Fix access to array after target element has been removed

This commit is contained in:
baldurk
2019-09-04 16:22:29 +01:00
parent 60faef5ce5
commit 6db13115a3
@@ -298,8 +298,13 @@ void PersistantConfig::UpdateEnumeratedProtocolDevices()
QMap<rdcstr, RemoteHost> oldHosts;
for(int i = RemoteHostList.count() - 1; i >= 0; i--)
{
if(RemoteHostList[i].Protocol())
oldHosts[RemoteHostList[i].Hostname()] = RemoteHostList.takeAt(i);
{
RemoteHost host = RemoteHostList.takeAt(i);
oldHosts[host.Hostname()] = host;
}
}
for(RemoteHost host : enumeratedDevices)
{