From 48b23bbfa0271ed327f668933b92d2ae9b99e806 Mon Sep 17 00:00:00 2001 From: Jan-Marek Glogowski Date: Wed, 20 Nov 2019 12:18:39 +0000 Subject: 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 --- basic/source/basmgr/basicmanagerrepository.cxx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'basic') 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 pManager = std::move(_pos->second); + Reference 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); } -- cgit