loplugin:unodispose in editeng..extensions

Change-Id: I6545cf93b0a101d3a3eea0abe9c1732fcf3dc2d0
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156850
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
This commit is contained in:
Noel Grandin
2023-09-12 14:59:45 +02:00
parent 7bbe660255
commit fa0e4fa015
8 changed files with 53 additions and 2 deletions

View File

@@ -650,6 +650,7 @@ uno::Reference< text::XTextRange > SAL_CALL SvxUnoTextField::getAnchor()
void SAL_CALL SvxUnoTextField::dispose()
{
OComponentHelper::dispose();
mxAnchor.clear();
}
void SAL_CALL SvxUnoTextField::addEventListener( const uno::Reference< lang::XEventListener >& xListener )

View File

@@ -239,7 +239,10 @@ void SAL_CALL SvxUnoTextContent::dispose()
}
if( mxParentText.is() )
{
mxParentText->removeTextContent( this );
mxParentText.clear();
}
}
void SAL_CALL SvxUnoTextContent::addEventListener( const uno::Reference< lang::XEventListener >& xListener )

View File

@@ -289,6 +289,15 @@ void OleEmbeddedObject::Dispose()
}
m_xParentStorage.clear();
m_xClientSite.clear();
m_xClosePreventer.clear();
m_xNewCachedVisRepl.clear();
m_xNewParentStorage.clear();
m_xNewObjectStream.clear();
m_xCachedVisualRepresentation.clear();
m_xWrappedObject.clear();
m_xParent.clear();
m_pOleComponent.clear();
m_bDisposed = true;
}

View File

@@ -228,12 +228,15 @@ void BibFrameController_Impl::dispose()
if (xFrame.is())
xFrame->removeFrameActionListener( m_xImpl );
m_xFrame.clear();
aObject.Source = static_cast<XController*>(this);
m_xImpl->aLC.disposeAndClear(aObject);
m_xDatMan.clear();
m_aStatusListeners.clear();
m_xLastQueriedFocusWin.clear();
m_xWindow.clear();
m_xImpl.clear();
}
void BibFrameController_Impl::addEventListener( const uno::Reference< lang::XEventListener > & aListener )

View File

@@ -605,7 +605,22 @@ namespace pcr
// at this handler instance
}
IMPLEMENT_FORWARD_XCOMPONENT( GenericPropertyHandler, GenericPropertyHandler_Base );
void SAL_CALL GenericPropertyHandler::dispose( )
{
GenericPropertyHandler_Base::WeakComponentImplHelperBase::dispose();
m_xComponentIntrospectionAccess.clear();
m_xComponent.clear();
m_xTypeConverter.clear();
m_xPropertyState.clear();
}
void SAL_CALL GenericPropertyHandler::addEventListener( const css::uno::Reference< css::lang::XEventListener >& Listener )
{
GenericPropertyHandler_Base::WeakComponentImplHelperBase::addEventListener( Listener );
}
void SAL_CALL GenericPropertyHandler::removeEventListener( const css::uno::Reference< css::lang::XEventListener >& Listener )
{
GenericPropertyHandler_Base::WeakComponentImplHelperBase::removeEventListener( Listener );
}
} // namespace pcr

View File

@@ -490,6 +490,9 @@ namespace pcr
m_aInspectedObjects.clear();
impl_bindToNewModel_nothrow( nullptr );
m_xModel.clear();
m_xInteractiveHandler.clear();
m_xFrame.clear();
}
void SAL_CALL OPropertyBrowserController::addEventListener( const Reference< XEventListener >& _rxListener )

View File

@@ -242,7 +242,22 @@ namespace pcr
return true;
}
IMPLEMENT_FORWARD_XCOMPONENT( PropertyHandler, PropertyHandler_Base )
void SAL_CALL PropertyHandler::dispose( )
{
PropertyHandler_Base::WeakComponentImplHelperBase::dispose();
m_xComponent.clear();
m_xComponentPropertyInfo.clear();
m_xTypeConverter.clear();
}
void SAL_CALL PropertyHandler::addEventListener( const css::uno::Reference< css::lang::XEventListener >& Listener )
{
PropertyHandler_Base::WeakComponentImplHelperBase::addEventListener( Listener );
}
void SAL_CALL PropertyHandler::removeEventListener( const css::uno::Reference< css::lang::XEventListener >& Listener )
{
PropertyHandler_Base::WeakComponentImplHelperBase::removeEventListener( Listener );
}
void SAL_CALL PropertyHandler::disposing()
{

View File

@@ -163,6 +163,8 @@ namespace pcr
m_xConnection.clear();
m_xContext.clear();
m_xORB.clear();
m_xDesigner.clear();
m_xObjectAdapter.clear();
}