Kaydet (Commit) acca22d6 authored tarafından Stephan Bergmann's avatar Stephan Bergmann

Related rhbz#928568: Detect aggregators listening at themselves

...which would lead to infinite recursion during disposing.

Change-Id: Ie895dbf8b4497296f2216edeac012f242d720adf
üst 7eaf1e93
......@@ -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 );
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment