summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan-Marek Glogowski <jan-marek.glogowski@extern.cib.de>2019-11-20 12:18:39 +0000
committerJan-Marek Glogowski <glogow@fbihome.de>2019-11-20 19:59:00 +0100
commit48b23bbfa0271ed327f668933b92d2ae9b99e806 (patch)
treef4a2893ab75c3b50132255ae24b042e089046dc1
parent03e9ae0a10bfcc91e646b67b032c1fb7b26da0d3 (diff)
tdf#128434 free the BasicManager event listener
This gets rid of the last 72 lost bytes I could identify in the huge valgrind logs to look like its PDF generation related. Change-Id: Idda3c2c5b7f5ce0211199b86503037b74438ccf2 Reviewed-on: https://gerrit.libreoffice.org/83302 Tested-by: Jenkins Reviewed-by: Jan-Marek Glogowski <glogow@fbihome.de>
-rw-r--r--basic/source/basmgr/basicmanagerrepository.cxx6
-rw-r--r--unotools/source/misc/eventlisteneradapter.cxx3
2 files changed, 6 insertions, 3 deletions
diff --git a/basic/source/basmgr/basicmanagerrepository.cxx b/basic/source/basmgr/basicmanagerrepository.cxx
index 9e3aecc249e0..edc73fed8c4a 100644
--- a/basic/source/basmgr/basicmanagerrepository.cxx
+++ b/basic/source/basmgr/basicmanagerrepository.cxx
@@ -537,12 +537,16 @@ namespace basic
OSL_PRECOND( _pos != m_aStore.end(), "ImplRepository::impl_removeFromRepository: invalid position!" );
std::unique_ptr<BasicManager> pManager = std::move(_pos->second);
+ Reference<XModel> xModel(_pos->first, UNO_QUERY);
// *first* remove from map (else Notify won't work properly)
m_aStore.erase( _pos );
- // *then* delete the BasicManager
EndListening( *pManager );
+
+ assert(xModel.is());
+ if (xModel.is())
+ stopComponentListening(xModel);
}
diff --git a/unotools/source/misc/eventlisteneradapter.cxx b/unotools/source/misc/eventlisteneradapter.cxx
index ac3dbe9c615e..c9f6b6f73ee9 100644
--- a/unotools/source/misc/eventlisteneradapter.cxx
+++ b/unotools/source/misc/eventlisteneradapter.cxx
@@ -84,7 +84,6 @@ namespace utl
{
Reference< XEventListener > xDeleteUponLeaving = m_xKeepMeAlive;
m_xKeepMeAlive.clear();
- m_xComponent.clear();
m_pAdapter->_disposing(_rSource);
}
@@ -118,7 +117,7 @@ namespace utl
do
{
rtl::Reference<OEventListenerImpl>& pListenerImpl = *it;
- if ( pListenerImpl->getComponent().get() == _rxComp.get() )
+ if ((pListenerImpl->getComponent().get() == _rxComp.get()) || (pListenerImpl->getComponent() == _rxComp))
{
pListenerImpl->dispose();
it = m_pImpl->aListeners.erase( it );