diff --git a/sfx2/source/appl/appquit.cxx b/sfx2/source/appl/appquit.cxx index 7a5daab00d88..b94436a0a488 100644 --- a/sfx2/source/appl/appquit.cxx +++ b/sfx2/source/appl/appquit.cxx @@ -131,15 +131,15 @@ void SfxApplication::Deinitialize() // from here no SvObjects have to exists DELETEZ(pAppData_Impl->pMatcher); - DELETEX(pAppData_Impl->pSlotPool); - DELETEX(pAppData_Impl->pFactArr); + DELETEX(SfxSlotPool, pAppData_Impl->pSlotPool); + DELETEX(SfxChildWinFactArr_Impl, pAppData_Impl->pFactArr); - DELETEX(pAppData_Impl->pTbxCtrlFac); - DELETEX(pAppData_Impl->pStbCtrlFac); - DELETEX(pAppData_Impl->pMenuCtrlFac); - DELETEX(pAppData_Impl->pViewFrames); - DELETEX(pAppData_Impl->pViewShells); - DELETEX(pAppData_Impl->pObjShells); + DELETEX(SfxTbxCtrlFactArr_Impl, pAppData_Impl->pTbxCtrlFac); + DELETEX(SfxStbCtrlFactArr_Impl, pAppData_Impl->pStbCtrlFac); + DELETEX(SfxMenuCtrlFactArr_Impl, pAppData_Impl->pMenuCtrlFac); + DELETEX(SfxViewFrameArr_Impl, pAppData_Impl->pViewFrames); + DELETEX(SfxViewShellArr_Impl, pAppData_Impl->pViewShells); + DELETEX(SfxObjectShellArr_Impl, pAppData_Impl->pObjShells); //TODO/CLEANTUP //ReleaseArgs could be used instead! diff --git a/sfx2/source/dialog/templdlg.cxx b/sfx2/source/dialog/templdlg.cxx index 203f2006b74a..1dee9ace33f1 100644 --- a/sfx2/source/dialog/templdlg.cxx +++ b/sfx2/source/dialog/templdlg.cxx @@ -1013,10 +1013,10 @@ void SfxCommonTemplateDialog_Impl::ClearResource() void SfxCommonTemplateDialog_Impl::impl_clear() { - DELETEX(pStyleFamilies); + DELETEX(SfxStyleFamilies, pStyleFamilies); sal_uInt16 i; for ( i = 0; i < MAX_FAMILIES; ++i ) - DELETEX(pFamilyState[i]); + DELETEX(SfxTemplateItem, pFamilyState[i]); for ( i = 0; i < COUNT_BOUND_FUNC; ++i ) delete pBoundItems[i]; pCurObjShell = NULL; diff --git a/sfx2/source/doc/objxtor.cxx b/sfx2/source/doc/objxtor.cxx index 2acf6c4e1c96..dcb4f1bf42bd 100644 --- a/sfx2/source/doc/objxtor.cxx +++ b/sfx2/source/doc/objxtor.cxx @@ -363,7 +363,7 @@ SfxObjectShell::~SfxObjectShell() SfxObjectShell::Close(); pImp->pBaseModel.set( NULL ); - DELETEX(pImp->pReloadTimer ); + DELETEX(AutoReloadTimer_Impl, pImp->pReloadTimer ); SfxApplication *pSfxApp = SFX_APP(); if ( USHRT_MAX != pImp->nVisualDocumentNumber ) @@ -398,7 +398,7 @@ SfxObjectShell::~SfxObjectShell() if ( IsDocShared() ) FreeSharedFile(); #endif - DELETEX( pMedium ); + DELETEX( SfxMedium, pMedium ); } // The removing of the temporary file must be done as the latest step in the document destruction diff --git a/sfx2/source/inc/sfxtypes.hxx b/sfx2/source/inc/sfxtypes.hxx index aa573a002687..e12ed3b67fb3 100644 --- a/sfx2/source/inc/sfxtypes.hxx +++ b/sfx2/source/inc/sfxtypes.hxx @@ -34,9 +34,10 @@ #ifndef DELETEX #ifdef DBG_UTIL -#define DELETEX(pPtr) ( delete pPtr, (void*&) pPtr = (void*) 0xFFFFFFFF ) +#define DELETEX(T, pPtr) \ + ( delete pPtr, pPtr = reinterpret_cast(sal_IntPtr(-1)) ) #else -#define DELETEX(pPtr) delete pPtr +#define DELETEX(T, pPtr) delete pPtr #endif #endif