[Libreoffice-commits] core.git: binaryurp/source
Julien Nabet
serval2412 at yahoo.fr
Thu Nov 23 06:04:27 UTC 2017
binaryurp/source/bridge.cxx | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
New commits:
commit 86cda9ab3cdfc2f253b4d2f44dd00f40d8574210
Author: Julien Nabet <serval2412 at yahoo.fr>
Date: Wed Nov 22 18:48:12 2017 +0100
Revert partly 9d1f61a61893435b26f7239136ad92b7354545a8
The use of erase/remove idiom is wrong here since "there can be multiple
registrations of the same listener"
See Stephan's comments in https://gerrit.libreoffice.org/#/c/44892/3/binaryurp/source/bridge.cxx
Change-Id: Iebf979ca25520392ba9de6439d5bf19b8e3446b2
Reviewed-on: https://gerrit.libreoffice.org/45104
Tested-by: Julien Nabet <serval2412 at yahoo.fr>
Reviewed-by: Julien Nabet <serval2412 at yahoo.fr>
diff --git a/binaryurp/source/bridge.cxx b/binaryurp/source/bridge.cxx
index 92a1665d8a45..d39d1f24e667 100644
--- a/binaryurp/source/bridge.cxx
+++ b/binaryurp/source/bridge.cxx
@@ -927,7 +927,11 @@ void Bridge::removeEventListener(
css::uno::Reference< css::lang::XEventListener > const & aListener)
{
osl::MutexGuard g(mutex_);
- listeners_.erase(std::remove(listeners_.begin(), listeners_.end(), aListener), listeners_.end());
+ Listeners::iterator i(
+ std::find(listeners_.begin(), listeners_.end(), aListener));
+ if (i != listeners_.end()) {
+ listeners_.erase(i);
+ }
}
void Bridge::sendCommitChangeRequest() {
More information about the Libreoffice-commits
mailing list