| commit | 61308112435628177b7884ab833ece843d37cd28 | [log] |
|---|---|---|
| author | Matt K <mattkse@gmail.com> | Sun Nov 26 19:01:20 2023 -0600 |
| committer | Noel Grandin <noel.grandin@collabora.co.uk> | Tue Nov 28 06:16:54 2023 +0100 |
| tree | f98088d931bfada8a948a15469594e4b62073be7 | |
| parent | 9e876c164a1d9e552c08be3112ada09712a20eb3 [diff] |
tdf#156648 Prevent LO from adding an empty event listener The problem is that an empty interface listener can be added in Basic, which then crashes when trying to fire an event on that listener. The fix is to check for the existence of the listener before adding to the list of listeners. Change-Id: I3205ec1e6cdad431f6297f2b7833295b9eb64b8e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159978 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
diff --git a/comphelper/source/container/interfacecontainer2.cxx b/comphelper/source/container/interfacecontainer2.cxx index 9acff0a..df1c9e0e 100644 --- a/comphelper/source/container/interfacecontainer2.cxx +++ b/comphelper/source/container/interfacecontainer2.cxx
@@ -172,6 +172,9 @@ void OInterfaceContainerHelper2::copyAndResetInUse() sal_Int32 OInterfaceContainerHelper2::addInterface( const Reference<XInterface> & rListener ) { OSL_ASSERT( rListener.is() ); if ( !rListener.is() ) return 0; MutexGuard aGuard( rMutex ); if( bInUse ) copyAndResetInUse();