Author: af Date: Thu Apr 4 11:44:36 2013 New Revision: 1464475 URL: http://svn.apache.org/r1464475 Log: i121420: Avoid assertion when broadcasting context changes while frame is being destroyed.
Modified: openoffice/branches/sidebar/main/sfx2/source/sidebar/ContextChangeBroadcaster.cxx Modified: openoffice/branches/sidebar/main/sfx2/source/sidebar/ContextChangeBroadcaster.cxx URL: http://svn.apache.org/viewvc/openoffice/branches/sidebar/main/sfx2/source/sidebar/ContextChangeBroadcaster.cxx?rev=1464475&r1=1464474&r2=1464475&view=diff ============================================================================== --- openoffice/branches/sidebar/main/sfx2/source/sidebar/ContextChangeBroadcaster.cxx (original) +++ openoffice/branches/sidebar/main/sfx2/source/sidebar/ContextChangeBroadcaster.cxx Thu Apr 4 11:44:36 2013 @@ -93,9 +93,10 @@ void ContextChangeBroadcaster::Broadcast if (rsContextName.getLength() == 0) return; - if ( ! rxFrame.is()) + if ( ! rxFrame.is() || ! rxFrame->getController().is()) { - OSL_ENSURE(false, "Activate called with invalid frame"); + // Frame is (probably) being deleted. Broadcasting context + // changes is not necessary anymore. return; } @@ -116,6 +117,8 @@ void ContextChangeBroadcaster::Broadcast OUString ContextChangeBroadcaster::GetModuleName (const cssu::Reference<css::frame::XFrame>& rxFrame) { + if ( ! rxFrame.is() || ! rxFrame->getController().is()) + return OUString(); OUString sModuleName; try {