summaryrefslogtreecommitdiff
path: root/binaryurp
diff options
context:
space:
mode:
authorJulien Nabet <serval2412@yahoo.fr>2017-11-22 18:48:12 +0100
committerJulien Nabet <serval2412@yahoo.fr>2017-11-23 07:03:58 +0100
commit86cda9ab3cdfc2f253b4d2f44dd00f40d8574210 (patch)
tree1bfeae188ba56bd979f6ddd5b1a8b149c6761963 /binaryurp
parenta675428e349d3424ffcc844e9c3884a82cf82ef7 (diff)
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@yahoo.fr> Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
Diffstat (limited to 'binaryurp')
-rw-r--r--binaryurp/source/bridge.cxx6
1 files changed, 5 insertions, 1 deletions
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() {