expand out DELETEZ in sfx2

Change-Id: Iced9299be454f5260582b0b639aad8e5d362d730
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/100620
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
This commit is contained in:
Noel Grandin
2020-08-12 12:05:58 +02:00
parent 8ce3647224
commit 8143a2023f
5 changed files with 17 additions and 8 deletions

View File

@@ -2932,7 +2932,8 @@ bool SfxObjectShell::PreDoSaveAs_Impl(const OUString& rFileName, const OUString&
// TODO/LATER: disconnect the new file from the storage for the case when pure saving is done // TODO/LATER: disconnect the new file from the storage for the case when pure saving is done
// if storing has corrupted the file, probably it must be restored either here or // if storing has corrupted the file, probably it must be restored either here or
// by the storage // by the storage
DELETEZ( pNewFile ); delete pNewFile;
pNewFile = nullptr;
} }
} }
else else
@@ -2942,11 +2943,12 @@ bool SfxObjectShell::PreDoSaveAs_Impl(const OUString& rFileName, const OUString&
// reconnect to the old storage // reconnect to the old storage
DoSaveCompleted(); DoSaveCompleted();
DELETEZ( pNewFile ); delete pNewFile;
pNewFile = nullptr;
} }
if ( bCopyTo ) if ( bCopyTo )
DELETEZ( pNewFile ); delete pNewFile;
else if( !bOk ) else if( !bOk )
SetModified(); SetModified();

View File

@@ -324,7 +324,8 @@ SfxObjectShell::~SfxObjectShell()
if (IsDocShared()) if (IsDocShared())
FreeSharedFile( pMedium->GetURLObject().GetMainURL( INetURLObject::DecodeMechanism::NONE ) ); FreeSharedFile( pMedium->GetURLObject().GetMainURL( INetURLObject::DecodeMechanism::NONE ) );
#endif #endif
DELETEZ( pMedium ); delete pMedium;
pMedium = nullptr;
} }
// The removing of the temporary file must be done as the latest step in the document destruction // The removing of the temporary file must be done as the latest step in the document destruction

View File

@@ -145,8 +145,10 @@ sal_uInt16 CntItemPool::Release()
if ( !nRefs ) if ( !nRefs )
{ {
DELETEZ( _pThePool ); delete _pThePool;
DELETEZ( pPoolDefs_Impl ); _pThePool = nullptr;
delete pPoolDefs_Impl;
pPoolDefs_Impl = nullptr;
return 0; return 0;
} }

View File

@@ -143,7 +143,10 @@ void SfxFrame::DoClose_Impl()
pImpl->pCurrentViewFrame->Close(); pImpl->pCurrentViewFrame->Close();
if ( pImpl->bOwnsBindings ) if ( pImpl->bOwnsBindings )
DELETEZ( pBindings ); {
delete pBindings;
pBindings = nullptr;
}
delete this; delete this;
} }

View File

@@ -203,7 +203,8 @@ void SAL_CALL SfxInPlaceClient_Impl::notifyEvent( const document::EventObject& a
void SAL_CALL SfxInPlaceClient_Impl::disposing( const css::lang::EventObject& /*aEvent*/ ) void SAL_CALL SfxInPlaceClient_Impl::disposing( const css::lang::EventObject& /*aEvent*/ )
{ {
DELETEZ( m_pClient ); delete m_pClient;
m_pClient = nullptr;
} }
// XEmbeddedClient // XEmbeddedClient