aboutsummaryrefslogtreecommitdiff
path: root/layers
diff options
context:
space:
mode:
authorCourtney Goeltzenleuchter <courtney@LunarG.com>2015-04-27 15:00:47 -0600
committerCourtney Goeltzenleuchter <courtney@LunarG.com>2015-04-29 11:25:22 -0600
commit60f084e5726a7b9dfd88d5b583ab48e526e80a63 (patch)
tree7c844ac2e3990e9b1d872a795340da7c1ee24bd2 /layers
parentb7e227098fcd7f33a665c5aa3ca59d8c30da8ac0 (diff)
downloadusermoji-60f084e5726a7b9dfd88d5b583ab48e526e80a63.tar.xz
mem_tracker: Do not increment iterator after delete
The loop was blindly incrementing the iterator and it should not. In the delete case the loop should resume with the iterator returned by the delete as it's the next element in the list.
Diffstat (limited to 'layers')
-rw-r--r--layers/mem_tracker.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/layers/mem_tracker.cpp b/layers/mem_tracker.cpp
index dc3dda4c..771feb8b 100644
--- a/layers/mem_tracker.cpp
+++ b/layers/mem_tracker.cpp
@@ -1101,9 +1101,11 @@ VK_LAYER_EXPORT VkResult VKAPI vkQueueRemoveMemReferences(
layerCbMsg(VK_DBG_MSG_ERROR, VK_VALIDATION_LEVEL_0, queue, 0, MEMTRACK_INVALID_QUEUE, "MEM", str);
} else {
for (uint32_t i = 0; i < count; i++) {
- for (list<VkDeviceMemory>::iterator it = pQueueInfo->pMemRefList.begin(); it != pQueueInfo->pMemRefList.end(); ++it) {
+ for (list<VkDeviceMemory>::iterator it = pQueueInfo->pMemRefList.begin(); it != pQueueInfo->pMemRefList.end();) {
if ((*it) == pMems[i]) {
it = pQueueInfo->pMemRefList.erase(it);
+ } else {
+ ++it;
}
}
}