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
This commit is contained in:
Michael Stahl 2016-11-22 22:49:15 +01:00
parent e77c931f44
commit f6d2ff1cb7

View File

@ -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);
}
}
}