[Libreoffice-commits] core.git: basic/source unotools/source

Jan-Marek Glogowski (via logerrit) logerrit at kemper.freedesktop.org
Wed Nov 20 19:00:21 UTC 2019


 basic/source/basmgr/basicmanagerrepository.cxx |    6 +++++-
 unotools/source/misc/eventlisteneradapter.cxx  |    3 +--
 2 files changed, 6 insertions(+), 3 deletions(-)

New commits:
commit 48b23bbfa0271ed327f668933b92d2ae9b99e806
Author:     Jan-Marek Glogowski <jan-marek.glogowski at extern.cib.de>
AuthorDate: Wed Nov 20 12:18:39 2019 +0000
Commit:     Jan-Marek Glogowski <glogow at fbihome.de>
CommitDate: Wed Nov 20 19:59:00 2019 +0100

    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 at fbihome.de>

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


More information about the Libreoffice-commits mailing list