From 6db13115a341d0565fd7db412723c8ca82947025 Mon Sep 17 00:00:00 2001 From: baldurk Date: Wed, 4 Sep 2019 16:22:29 +0100 Subject: [PATCH] Fix access to array after target element has been removed --- qrenderdoc/Code/Interface/PersistantConfig.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/qrenderdoc/Code/Interface/PersistantConfig.cpp b/qrenderdoc/Code/Interface/PersistantConfig.cpp index 0c8838474..e65d43a20 100644 --- a/qrenderdoc/Code/Interface/PersistantConfig.cpp +++ b/qrenderdoc/Code/Interface/PersistantConfig.cpp @@ -298,8 +298,13 @@ void PersistantConfig::UpdateEnumeratedProtocolDevices() QMap 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) {