diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-01-20 12:05:56 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-01-20 12:52:45 +0200 |
commit | f7db2b5b3ffe7bff84636cdd0017e85a439b8c4f (patch) | |
tree | 9ec05735d8b315f078f52e71896f4f3dd5e168d9 /comphelper/source | |
parent | 7cf3ae68afb9d3f2f126e544de85f38a18ad3de0 (diff) |
use rtl::Reference in OSelectionChangeListener
instead of manual acquire/release
Change-Id: I33e3018b5deb4240d4aff1d8136ae6f8f538c779
Diffstat (limited to 'comphelper/source')
-rw-r--r-- | comphelper/source/misc/SelectionMultiplex.cxx | 15 |
1 files changed, 2 insertions, 13 deletions
diff --git a/comphelper/source/misc/SelectionMultiplex.cxx b/comphelper/source/misc/SelectionMultiplex.cxx index f7122d40b946..15c2c9476b6e 100644 --- a/comphelper/source/misc/SelectionMultiplex.cxx +++ b/comphelper/source/misc/SelectionMultiplex.cxx @@ -44,19 +44,8 @@ void OSelectionChangeListener::_disposing(const EventObject&) void OSelectionChangeListener::setAdapter(OSelectionChangeMultiplexer* pAdapter) { - if (m_pAdapter) - { - ::osl::MutexGuard aGuard(m_rMutex); - m_pAdapter->release(); - m_pAdapter = nullptr; - } - - if (pAdapter) - { - ::osl::MutexGuard aGuard(m_rMutex); - m_pAdapter = pAdapter; - m_pAdapter->acquire(); - } + ::osl::MutexGuard aGuard(m_rMutex); + m_xAdapter = pAdapter; } OSelectionChangeMultiplexer::OSelectionChangeMultiplexer(OSelectionChangeListener* _pListener, const Reference< XSelectionSupplier>& _rxSet) |