summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2013-03-28 13:28:03 +0100
committerStephan Bergmann <sbergman@redhat.com>2013-03-28 13:30:41 +0100
commitacca22d64283905048a9441fd30e7179361f2666 (patch)
tree1b9f1255917548a5e311cbbb4ccdb23a97306016
parent7eaf1e93889568b6cd9f721b42a3fd4bbe59f8b6 (diff)
Related rhbz#928568: Detect aggregators listening at themselves
...which would lead to infinite recursion during disposing. Change-Id: Ie895dbf8b4497296f2216edeac012f242d720adf
-rw-r--r--comphelper/source/misc/proxyaggregation.cxx11
1 files changed, 9 insertions, 2 deletions
diff --git a/comphelper/source/misc/proxyaggregation.cxx b/comphelper/source/misc/proxyaggregation.cxx
index a8771d6a2249..9a19cf5c99d0 100644
--- a/comphelper/source/misc/proxyaggregation.cxx
+++ b/comphelper/source/misc/proxyaggregation.cxx
@@ -17,6 +17,10 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
+#include "sal/config.h"
+
+#include <cassert>
+
#include <comphelper/proxyaggregation.hxx>
#include <com/sun/star/reflection/ProxyFactory.hpp>
@@ -233,8 +237,11 @@ namespace comphelper
//--------------------------------------------------------------------
void SAL_CALL OComponentProxyAggregation::disposing( const EventObject& _rSource ) throw (RuntimeException)
{
- // simly disambiguate - this is necessary for MSVC to distinguish
- // "disposing( EventObject )" from "disposing()"
+ // Simply disambiguate---this is necessary for MSVC to distinguish
+ // "disposing(EventObject)" from "disposing()"; but it is also a good
+ // place to check for recursive calls that would be caused by an object
+ // being registered as an XEventListener at itself (cf. rhbz#928568):
+ assert(_rSource.Source != static_cast< cppu::OWeakObject * >(this));
OComponentProxyAggregationHelper::disposing( _rSource );
}