diff options
author | Michael Stahl <mstahl@redhat.com> | 2017-05-04 22:18:05 +0200 |
---|---|---|
committer | Michael Stahl <mstahl@redhat.com> | 2017-05-04 22:18:05 +0200 |
commit | 670631cae260263e4822d8aa63bc5c2e4349c796 (patch) | |
tree | 94e365396b7d76cdcb2a0367a835bca9ea278395 | |
parent | baa253d00ab6aa67fa100472db00227baa14c87a (diff) |
sd: oops, skipped one entry on every erase by incrementing
Thanks Noel for the hint.
Change-Id: I4992ce6d92ea185c7ab2f3ca452d3920204bb9f7
-rw-r--r-- | sd/source/ui/presenter/CanvasUpdateRequester.cxx | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/sd/source/ui/presenter/CanvasUpdateRequester.cxx b/sd/source/ui/presenter/CanvasUpdateRequester.cxx index ee385533773f..456c37d43a58 100644 --- a/sd/source/ui/presenter/CanvasUpdateRequester.cxx +++ b/sd/source/ui/presenter/CanvasUpdateRequester.cxx @@ -44,10 +44,14 @@ std::shared_ptr<CanvasUpdateRequester> CanvasUpdateRequester::Instance ( static std::vector<std::pair< uno::WeakReference<rendering::XSpriteCanvas>, std::weak_ptr<CanvasUpdateRequester>>> s_RequesterMap; - for (auto it = s_RequesterMap.begin(); it != s_RequesterMap.end(); ++it) + for (auto it = s_RequesterMap.begin(); it != s_RequesterMap.end(); ) { uno::Reference<rendering::XSpriteCanvas> const xCanvas(it->first); - if (xCanvas == rxSharedCanvas) + if (!xCanvas.is()) + { + it = s_RequesterMap.erase(it); // remove stale entry + } + else if (xCanvas == rxSharedCanvas) { std::shared_ptr<CanvasUpdateRequester> pRequester(it->second); if (pRequester) @@ -64,10 +68,7 @@ std::shared_ptr<CanvasUpdateRequester> CanvasUpdateRequester::Instance ( } else { - if (!xCanvas.is()) - { - it = s_RequesterMap.erase(it); // remove stale entry - } + ++it; } } |