From f6d2ff1cb7f0f4917a0d4df38d5dcff8e37d20cc Mon Sep 17 00:00:00 2001 From: Michael Stahl Date: Tue, 22 Nov 2016 22:49:15 +0100 Subject: [PATCH] presenter console: fix STL assert when exiting slide show AtkListener::handleChildRemoved() calls removeAccessibleEventListener(), apparently without the listener being registered, so the remove() returns end(), which isn't valid for erase(). (probably happens since e4e208fa2b0930be5a7cbbe2fab2ff2fe2c4a1ff) Change-Id: Ia0de1bafe214f5a46f250d6573d8c4b408c9cf26 --- sdext/source/presenter/PresenterAccessibility.cxx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/sdext/source/presenter/PresenterAccessibility.cxx b/sdext/source/presenter/PresenterAccessibility.cxx index 7c474b288daf..48916ebf025a 100644 --- a/sdext/source/presenter/PresenterAccessibility.cxx +++ b/sdext/source/presenter/PresenterAccessibility.cxx @@ -1109,7 +1109,11 @@ void SAL_CALL PresenterAccessible::AccessibleObject::removeAccessibleEventListen { const osl::MutexGuard aGuard(m_aMutex); - maListeners.erase(std::remove(maListeners.begin(), maListeners.end(), rxListener)); + auto const it(std::remove(maListeners.begin(), maListeners.end(), rxListener)); + if (it != maListeners.end()) + { + maListeners.erase(it); + } } }